Forum Discussion

M_SBS_6's avatar
M_SBS_6
Helper V
3 years ago
Solved

Incorrect Totals - Matrix

Hi,  I have the following measure which works as expected however, the grand totals don't show the expected value.   I have tried to add in HASONEVALUE, SUMX and create new measures on the back of...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi  M_SBS_6 ,

    I created some data:

    Here are the steps you can follow:

     

    1. Create measure.

     

    Measure2 =
    var _table1=
    SUMMARIZE(
        'Table','Table'[Group],"Value1",[Measure])
    var _table2=
    SUMMARIZE(
        'Table','Table'[Group2],"Value2",[Measure])
    return
    IF(
        NOT(HASONEVALUE('Table'[Group2])),SUMX(_table2,[Value2]),
        IF(
            NOT(HASONEVALUE('Table'[Group])),SUMX(_table1,[Value1]),[Measure])
    )

     

    2. Result:

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly