Forum Discussion
Optimize Running Total
- 3 years ago
Hi, GillyGils
You can try the following methods.
Measure:
Running Head Count = SUMX(FILTER(ALL('Table'),[Date]<=SELECTEDVALUE('Table'[Date])),[Head Count])Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
GillyGils Use a date table and try like. Date table's date should be joined with date of your table. Use date/month from date table in visual, slicer and measures
CALCULATE([Head Count],filter(allselected(date),date[date] <=max(date[Date])))
or
Cumm Based on Date = CALCULATE([Head Count], Window(1,ABS,0,REL, ALLSELECTED('date'[date]),ORDERBY('Date'[date],ASC)))
or
CALCULATE([Head Count],filter(all(date),date[date] <=max(date[Date])))
or
Cumm Based on Date = CALCULATE([Head Count], Window(1,ABS,0,REL, all('date'[date]),ORDERBY('Date'[date],ASC)))
Running Total/ Cumulative:
https://www.youtube.com/watch?v=h2wsO332LUo&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=42
Power BI Window function Rolling, Cumulative/Running Total, WTD, MTD, QTD, YTD, FYTD: https://youtu.be/nxc_IWl-tTc
- GillyGils3 years agoFrequent Visitor
Thanks for the response.
In my fact table, its only monthly data. So I only have month end dates so which are a whole number in which ive converted to 'Date'. Is there a solution to not have a date table included?
- v-zhangti3 years agoCommunity Support
Hi, GillyGils
You can try the following methods.
Measure:
Running Head Count = SUMX(FILTER(ALL('Table'),[Date]<=SELECTEDVALUE('Table'[Date])),[Head Count])Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.