Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Measure Missing Sub Total and Total Data in Table

Hi all,

 

I've created a measure and correctly have the Metric values but some of the sub totals aren't showing any values.

 

I've noticed the total correctly calculates when the Activities[Measure Value] (green cross) and Activities[Attendance Value] are separated (red cross) column but not when they are combined, i.e. should be sum together (blue cross)

I've used the HASONEFILTER which I read about here, but to no success.

Any help would be greatly appreciated - thanks!

 

Metric Measure = 
IF(HASONEFILTER(Activities[Measure ID]),
DIVIDE(AVERAGE('Activities'[Measure Value]) + AVERAGE('Activities'[Attendance Value]),2),
SWITCH(SELECTEDVALUE('Measure'[Mechanism]),
"Survey Completion",
AVERAGE(Activities[Measure Value]),
"Workshop Attendance",
AVERAGE(Activities[Attendance Value])))

 

 

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous ,

    Please create another new measure as below to replace the original measure [Metric Measure] , and put this new measure onto the matrix visual. Later check if it can get your expected result.

    New Measure =
    SUMX (
        GROUPBY (
            'Activities',
            'Activities'[Phase],
            'Activities'[Metric],
            'Activities'[Measure]
        ),
        [Metric Measure]
    )

    In addition, you can refer the following links to try to solve your problem...

    Why Your Total Is Incorrect In Power BI - The Key DAX Concept To Understand

    Dax for Power BI: Fixing Incorrect Measure Totals

    If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

    How to upload PBI in Community

    Best Regards

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    Please create another new measure as below to replace the original measure [Metric Measure] , and put this new measure onto the matrix visual. Later check if it can get your expected result.

    New Measure =
    SUMX (
        GROUPBY (
            'Activities',
            'Activities'[Phase],
            'Activities'[Metric],
            'Activities'[Measure]
        ),
        [Metric Measure]
    )

    In addition, you can refer the following links to try to solve your problem...

    Why Your Total Is Incorrect In Power BI - The Key DAX Concept To Understand

    Dax for Power BI: Fixing Incorrect Measure Totals

    If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

    How to upload PBI in Community

    Best Regards

  • Anonymous's avatar
    Anonymous
    Not applicable

    It worked! Thanks so much for your help