Forum Discussion
SUMX Over Distinct and Max
- 5 years ago
Thanks for the replies but unfortunately they were not working for me.
I have managed to solve it using the following measure:Channels Total = SUMX( VALUES ( Charges[CLI] ), CALCULATE ( CALCULATE ( MAX ( Charges[Channels] ), FILTER ( VALUES ( Charges[BillingPeriod] ), Charges[BillingPeriod] = MAX ( Charges[BillingPeriod] ) ) ) ) )I have updated the sample project to reflect this:
https://1drv.ms/u/s!AoTVsSI4n62qjZ0Mq4u-5-4lAzqDqw?e=mYde5a
If anyone know a more efficient way to right this then I would love to hear.
Also I'm not sure why I had to use CALCULATE twice but it was the only way I could include part of the code without having to create a seperate measure.
If anyone has a good explanation for this then please let me know.
Thanks for the replies but unfortunately they were not working for me.
I have managed to solve it using the following measure:
Channels Total =
SUMX(
VALUES ( Charges[CLI] ),
CALCULATE (
CALCULATE (
MAX ( Charges[Channels] ),
FILTER (
VALUES ( Charges[BillingPeriod] ),
Charges[BillingPeriod] = MAX ( Charges[BillingPeriod] )
)
)
)
)
I have updated the sample project to reflect this:
https://1drv.ms/u/s!AoTVsSI4n62qjZ0Mq4u-5-4lAzqDqw?e=mYde5a
If anyone know a more efficient way to right this then I would love to hear.
Also I'm not sure why I had to use CALCULATE twice but it was the only way I could include part of the code without having to create a seperate measure.
If anyone has a good explanation for this then please let me know.