Forum Discussion
Youri98
1 year agoHelper I
DAX - cumulative % small difference. Rounding?
Hi! I've got a simple DAX showing the % per month. Dividing the new products / total per month. The % for each month is correct. Now, I would like to show a line in my chart, showing the cumulative ...
- 1 year ago
Youri98 The discrepancy you're seeing in the cumulative percentage values is likely due to the way cumulative percentages are calculated and possibly due to rounding differences
Calculate the cumulative total of new products:
DAX
CumulativeNewProducts =
CALCULATE(
SUM('Table'[New per month]),
FILTER(
ALLSELECTED('Table'),
'Table'[Month] <= MAX('Table'[Month])
)
)Calculate the cumulative total of all products:
DAX
CumulativeTotalProducts =
CALCULATE(
SUM('Table'[Total per month]),
FILTER(
ALLSELECTED('Table'),
'Table'[Month] <= MAX('Table'[Month])
)
)Calculate the cumulative percentage:
DAX
CumulativePercentage =
DIVIDE(
[CumulativeNewProducts],
[CumulativeTotalProducts],
0
)
Sahir_Maharaj
1 year agoSuper User
Hello Youri98,
Can you please try this approach:
Cumulative % True =
DIVIDE(
CALCULATE(SUM('Table'[New per month]), FILTER(ALLSELECTED('Table'), 'Table'[Month] <= MAX('Table'[Month]))),
CALCULATE(SUM('Table'[Total per month]), FILTER(ALLSELECTED('Table'), 'Table'[Month] <= MAX('Table'[Month])))
)