Conditional Execution of Playlists Using DAX Queries

Overview

This feature allows the execution of a playlist to be conditional based on the result of a DAX query. If the defined preconditions are not met (i.e., the DAX expression does not return TRUE) the report is skipped, the playlist proceeds without it, and the execution history reflects the reason.

Features

1. Execution Conditions via DAX

  • Users can define a DAX query as a prerequisite for running a report within a playlist.

  • If the query does not return TRUE, that report will be skipped during playlist execution.

  • The DAX condition can be configured per Report and/or per Recipient, following the same logic as filters.

2. User Interface Updates

  • The playlist UI has been updated to allow adding DAX conditions in the following sections:

    • Visuals tab - for report page conditions

    • Filters tab - for recipient conditions

  • Dashboards are not supported for this feature.

3. Conditional Execution Flow

  • If the DAX query returns TRUE: the report is rendered and sent as usual.

  • If the DAX query returns FALSE or encounters an error:

    • The report or the recipient is skipped.

    • The playlist continues executing, but the history will note the report was not sent.

    • The reason is recorded in the playlist execution history and system logs.

Advanced Configuration

Section: Advanced Settings

  • A new field labeled "Conditions" has been added.

  • Users can write a DAX expression that will be evaluated before execution.

  • Includes a "Test Condition" button to test the DAX expression immediately (similar to DataSet query validation).

Execution History

  • The playlist history indicates:

    • Whether each report was executed.

    • The reason a report was skipped (e.g., “DAX query did not return TRUE”).

    • Technical logs are available for further analysis.

Examples of Condition Queries

Condition: Sales for January 2025 are above 10000

EVALUATE
VAR TargetValue = 10000
VAR Result =
    CALCULATE (
        [Sales],
        'Date'[Month] = "Jan",
        'Date'[Year] = 2025
    )
RETURN
    ROW ( "Sales", Result > TargetValue )

Condition: User [email protected] has Revenue for January 2025

EVALUATE
ROW (
    "HasRevenueData",
    VAR RevenueInPeriod =
        CALCULATE (
            [Revenue],
            'Account'[PartnerEmail] = "[email protected]",
            'Fact'[Year] = 2025,
            'Fact'[Month] = "Jan"
        )
    RETURN NOT ISBLANK(RevenueInPeriod)
)

Condition: User [email protected] has Revenue over 3000 for January 2025

EVALUATE
ROW (
    "HasHighRevenue",
    VAR RevenueInPeriod =
        CALCULATE (
            [Revenue],
            'Account'[PartnerEmail] = "[email protected]",
            'Fact'[Year] = 2025,
            'Fact'[Month] = "Jan"
        )
    RETURN RevenueInPeriod > 3000
)

Note: You can replace the values with the available tokens

EVALUATE
ROW (
    "HasHighRevenue",
    VAR RevenueInPeriod =
        CALCULATE (
            [Revenue],
            'Account'[PartnerEmail] = "#RECIPIENT_EMAIL#",
            'Fact'[Year] = #YEAR#,
            'Fact'[Month] = "#MONTH_NAME#"
        )
    RETURN RevenueInPeriod > 3000
)

Last updated