Forum Discussion
Cumulative Inventory Sum Measure
- 5 years ago
hi Anonymous
You are missing ALL in your formula, just adjust it as below:
Cumm Sum = CALCULATE ( SUM ( Stock[Quantity] ), FILTER ( ALL ( TableFiscalCalendar ), TableFiscalCalendar[GregorianDate] <= MAX ( TableFiscalCalendar[GregorianDate] ) ) )Regards,
Lin
Anonymous , Create a date table and join it with your table and try a measure like
Cumm Sales = CALCULATE(SUM(Table[Quantity]),filter(date,date[date] <=maxx(date,date[date])))
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/
See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-YTD-LYTD-Week-Over-Week/m-p/1051626#M184
Appreciate your Kudos.
- Anonymous5 years agoNot applicable
Hi amitchandak , thanks for the response, however this measure not work. I have the date table (TableFiscalCalendar) marked as a date table and there is a relationship between Table and TableFiscalCalendar using Table[Date] and TableFiscalCalendar[GregorianDate] fields.
Cumm Sum = CALCULATE(SUM(Stock[Quantity]),filter(TableFiscalCalendar,TableFiscalCalendar[GregorianDate] <=maxx(TableFiscalCalendar,TableFiscalCalendar[GregorianDate])))Should this be adjusted?- v-lili6-msft5 years agoCommunity Support
hi Anonymous
You are missing ALL in your formula, just adjust it as below:
Cumm Sum = CALCULATE ( SUM ( Stock[Quantity] ), FILTER ( ALL ( TableFiscalCalendar ), TableFiscalCalendar[GregorianDate] <= MAX ( TableFiscalCalendar[GregorianDate] ) ) )Regards,
Lin