Forum Discussion

sivarajan21's avatar
sivarajan21
Icon for Post Prodigy rankPost Prodigy
2 years ago
Solved

Dax measure doesn't return correct total value for selected slicer

Hi,   Created a measure as below: &   But the above measures doesn't return correct values and it is not matching my expected result. My expected result is:     When I sele...
  • SamWiseOwl's avatar
    SamWiseOwl
    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])
        )