Forum Discussion
Dax measure doesn't return correct total value for selected slicer
- 2 years ago
Hi sivarajan21
So on the utility you want their average, on the total you want to calculate the average for each utilities average?Invoice Unit Rate test Sam =If(HASONEVALUE(Points[Utility]),CALCULATE([Invoice Unit Rate test 2], all(Points), Points[Utility] = SELECTEDVALUE(Points[Utility])),AVERAGEX(DISTINCT(Points[Utility]), [Invoice Unit Rate test 2]))
Hi SamWiseOwl ,
Thanks for your quick response!
Apologise for the confusion here!
We need both measures:
There is no problem with above measure, so please ignore it.
Now we need to work/modify on 'Invoice Unit Rate test 3' measure to make sure it calculates the average of their DBName_Point Id under their respective Utility(Electricity or Gas).
'Invoice Unit Rate test 3' measure achieves that when we select either 'Electricity' (0.15) only or 'Gas'(0.36) only from slicer. These numbers(0.15 & 0.36) are nothing but average of point id under their respective utility(Electricity/Gas).
But 'Invoice Unit Rate test 3' does not achieve that when we select both utlity in slicer as below:
It shows only 0.16 in every cell and total cell of the measure column.
My expected output is as below:
The above screenshot shows only two values(0.15 & 0.36) in every cell which is average of gas & electricity utility. The total shows average of 0.15 & 0.36 which is 0.25.For example in below screenshot
Green color highlight shows 0.15 as average for point id's that comes under electricity utility and 0.36 as average for point id's that comes under gas utility.
Please let me know if you need further information.
PFA file here Financial Management -Tanvi Copy 3 (3) (2) - Copy - Copy.pbix
Thanks in advance!
SamWiseOwl v-yinliw-msft Anonymous Anonymous Ahmedx marcorusso Greg_Deckler
Hi sivarajan21
So on the utility you want their average, on the total you want to calculate the average for each utilities average?
- sivarajan212 years ago
Post Prodigy
Hi SamWiseOwl ,
This time we did it!
Thanks for your quick response & amazing solution!
This worked like a gem and i will mark it as solution!
I have given kudos as well!
Many Thanks