Forum Discussion

Jayrx7's avatar
Jayrx7
Frequent Visitor
3 years ago
Solved

Countrow not working correctly with Calculate

Hello,    I tried to write a query that returns the rowcount for the rolling 28 days. Below is my query, but it isn't returning the correct output: ROLLING 28 = CALCULATE(COUNTROWS('Incidents'), ...
  • v-yalanwu-msft's avatar
    3 years ago

    Hi, Jayrx7 ;

    Try it.

    ROLLING 28 = CALCULATE(COUNTROWS('Table'), DATESINPERIOD('Table'[Date],CALCULATE( MAX('Table'[Date]),ALL('Table')),-28,DAY))

    The final show:

    slicer:

    measure.


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.