Forum Discussion
Cumulative amount in missing month
Hi everybody, please help.
I have a table with warehouses and movements for individual months.
I have a matrix with measure in the report:
Can anybody help with this maybe easy problem? ๐
Thank you.
Source file (pbix): https://file.io/LRnu50n2tFnW
Ooops. Sorry. I missed to add MAX in the formula. It should have been:
Cumulative = CALCULATE ( SUM ( Warehouses[Amount] ), FILTER ( ALL ( YearMonth ), YearMonth[YearMonth] <= MAX ( YearMonth[YearMonth] ) ) )Hi,
PBI file attached.
Hope this helps.
7 Replies
- OttoKokNew Member
Of course, sorry, here it is: Warehouses_test.pbix
- danextianSuper User
Hi OttoKok ,
If you want to get the cumulative total from 2023-01 up to the current month for each warehouse, create a separate dates table and use that to create time intelligence measure.
YearMonth = DISTINCT(Warehouses[YearMonth]) //separate tableCreate a relationship from that column to your date column in Warehouses and create this measure
Cumulative = CALCULATE ( SUM ( Warehouses[Amount] ), FILTER ( ALL ( YearMonth ), YearMonth[YearMonth] <= YearMonth[YearMonth] ), REMOVEFILTERS ( Warehouses[YearMonth] ) )Make sure to use the column from YearMonth in your visual.
Please see attached sample pbix