filterpowerbidaxsummarizecalculated-tables

Filter multiple tables


I am currently working on a DAX query and would like to enhance it by adding an additional filter before selecting the columns. The filter I want to apply is as follows:

EVALUATE 
VAR StartDate = TODAY () - 84
VAR EndDate = TODAY () - 3 
VAR RATIO_By_Date_Table =
FILTER (
    SUMMARIZE (
        FILTER (
            Dim_CALENDRIER,
            Dim_CALENDRIER[Date] >= FORMAT ( StartDate, "YYYY-MM-DD" )
                && Dim_CALENDRIER[Date] <= FORMAT ( EndDate, "YYYY-MM-DD" )
        ),
        Dim_CALENDRIER[Date],
        Dim_CALENDRIER[Semaine],
        'Dim_CALENDRIER'[Date.Key0],
        "RATIO", [RATIO]
    ),
    [RATIO] <> BLANK ()
)
RETURN
SELECTCOLUMNS (
    TOPN (
        COUNTROWS ( RATIO_By_Date_Table ),
        RATIO_By_Date_Table,
        Dim_CALENDRIER[Date], ASC
    ),
    "Date", Dim_CALENDRIER[Date],
    "Semaine", Dim_CALENDRIER[Semaine],
    "RATIO_NJSR", ROUND ( [RATIO], 2 )
)

FILTER:

FILTER(
        Dim_PERIMETRE, 
        Dim_PERIMETRE[Périmètre] = "Client"
    )

Could anyone provide guidance on how to incorporate this filter into my existing DAX code? If you could share an example or suggest modifications, I would greatly appreciate it.

Thank you for your assistance!


Solution

  • I found a solution to this problem by using the following method:

    CROSSJOIN(
                Dim_CALENDRIER,
                Dim_PERIMETRE
            )