Forum Discussion
DiDiliz
1 year agoFrequent Visitor
Add multiple selectedvalues
I am trying to create a measure which will add up the separate values which are selected in the slicer. However, because each value has a different calculation, I don't want it to add up the whole s...
- 1 year ago
Hi DiDiliz
Use the below dax:
Test Measure = SUMX( VALUES('TABLE1'[Week Commencing].[Month]) CALCULATE( SUM('TABLE2'[Hours]) * AVERAGE('TABLE1'[Budget %]), FILTER( 'TABLE1', 'TABLE1'[Week Commencing].[Month] = EARLIER('TABLE1'[Week Commencing].[Month]) ) ) )
DiDiliz
1 year agoFrequent Visitor
It's letting me select more than one month, however it's doubling the total. So May should be 74 but it's showing 149, June should be 67 but together with May it's showing 284.
This does feel like progress though. Thank you
Angith_Nair
Continued Contributor
1 year agoHi DiDiliz
Use the below dax:
Test Measure =
SUMX(
VALUES('TABLE1'[Week Commencing].[Month])
CALCULATE(
SUM('TABLE2'[Hours]) * AVERAGE('TABLE1'[Budget %]),
FILTER(
'TABLE1',
'TABLE1'[Week Commencing].[Month] = EARLIER('TABLE1'[Week Commencing].[Month])
)
)
)- DiDiliz1 year agoFrequent Visitor
That's done exactly what I was after. Thank you so much.