Forum Discussion
Abdel
2 years agoRegular Visitor
Cumulative sum
I have a dataset contains 52 week of sales : the table below is a sample of the dataset I have. Week Sales Actual/forecast 1 10 Actual 1 12 Forecast ...
- 2 years ago
Add this measure or club: I still not understand the intention ...
Sales for Actual = CALCULATE( SUM('salesdata'[Sales ]), 'salesdata'[Actual/forecast] IN { "Actual" } ) Sales for Forecast = CALCULATE( SUM('salesdata'[Sales ]), 'salesdata'[Actual/forecast] IN { "Forecast" } ) CT Actual or Forecast = SUMX ( CALCULATETABLE( values(salesdata[Week ]), salesdata[Week ] <= MAX(salesdata[Week ])) , COALESCE( salesdata[Sales for Actual], [Sales for Forecast]) )If you dont want multiple measures, you can club the measure logic into one measure!
Hoep this helps!
- 2 years ago
I do NOT see any issue.
Check these screenshots:
a) No selection
b) with selection of Week 2, week 2
b) with selection of Week 1, Week 4
Ashish_Mathur
2 years agoSuper User
Hi,
Do you have a Date column? If no, then do you have Year and Month columns? If you do have either, then share some data to work with. Also, share a Calendar table with a Week number column.