Forum Discussion

a_nijsten's avatar
a_nijsten
Regular Visitor
2 years ago
Solved

Selecting rows with slicer doesn't work

Hello, I am stuck with a Power BI problem. In the model there is a data table (Testdata) and a date table (Datetable). In the slicers, I have selected the year 2024 and the month of May. Based on t...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi,

    Thanks for the solution Ashish_Mathur  and elitesmitpatel  and foodd  provided, and i want to offer some more infotmation for user to refer to.

    hi a_nijsten , you can create a measure

    MEASURE =
    VAR a =
        MAX ( Datetable[Date] )
    VAR b =
        EOMONTH ( a, -1 ) + 1
    RETURN
        CALCULATE (
            COUNTROWS ( Testdata ),
            Testdata[Startdate] <= a,
            OR ( Testdata[Enddate] >= b, Testdata[Enddate] = BLANK () ),
            CROSSFILTER ( Datetable[Date], Testdata[Startdate], NONE )
        )
    

    Outptut

     

    Best Regards!

    Yolo Zhu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.