Forum Discussion

NAOS's avatar
NAOS
Advocate III
2 years ago
Solved

Cumulative count with AllSELECTED

Hi all,   I have a table of Records with two columns: "Status" and "Activation Date"   I use the following measure to return the cumulative count of records per "Activation Date": Cumulative_cou...
  • amitchandak's avatar
    2 years ago

    NAOS , Create a separate date table and join it with your date and use it

     

    Cumulative_count = CALCULATE ( COUNTROWS ( 'Records' ),
    FILTER ( ALLSELECTED ( 'Date' ), 'Date'[Date] <= MAX ( 'Date'[Date] )
    ))

     

     

    Using window function

     

    Cumm Based on Date = CALCULATE(COUNTROWS ( 'Records' ), Window(1,ABS,0,REL, ALLSELECTED('date'[date]),ORDERBY('Date'[date],ASC)))

     

    Continue to explore Power BI Window function Rolling, Cumulative/Running Total, WTD, MTD, QTD, YTD, FYTD: https://youtu.be/nxc_IWl-tTc
    https://medium.com/@amitchandak/power-bi-window-function-3d98a5b0e07f