Forum Discussion
Maha1
Helper II
3 years agoRunning count in Dax sort by date
Greetings, How can I create a colmn in DAX for running count of IDs, sorted descending by the date. For example: ID date RUNNING COUNT 111 1/1/2023 1 222 1...
- 3 years ago
Hi,
Write this calculated column formula
Running count = CALCULATE(COUNTROWS(Data),FILTER(Data,Data[ID]=EARLIER(Data[ID])&&Data[date]>=EARLIER(Data[date])))Hope this helps.
amitchandak
Super User
3 years agoMaha1 , a new measure
countx(filter(allselected(Table), Table[ID] = max(Table[ID]) && Table[Date] >= max(Table[Date]) ) , Table[ID])
You can also consider window function
Power BI Window function Rolling, Cumulative/Running Total, WTD, MTD, QTD, YTD, FYTD: https://youtu.be/nxc_IWl-tTc
Maha1
Helper II
3 years agothank you