Forum Discussion

Kalaivani's avatar
Kalaivani
Icon for Helper III rankHelper III
1 year ago

Row Level Totals Blank when adding Measure Names to rows in Matrix visual

I have a matrix visual where I added ProviderName and MeasureName to rows, Year-Month to columns and values based on a calculated measure.

The calculated measure :

SelectedMeasureCompare =
SWITCH(
    SELECTEDVALUE(MeasureSelector[MeasureName]),
    "Wrvus", [PivotWrvusCompare],
    "Wrvus per Visit", [Wrvus per Visit Compare],
    "Deficit Wrvus to 65th %tile", [DeficitWrvus65thcalCompare],
    BLANK()  -- Default if no selection 
)
 
I created this calculated measure in order to use the MeasureName as a filter, so that users select which measure they want to see. The issue is, Row level totals are empty and it is showing subtotals for each providername which is also empty. 

I want just the grand totals and no subtotals. I think the issue is because the measures I am using are not aggregating as expected across the row and column context.
 
Can anyone please help me achieve the grand totals? Thanks so much inadvance for your help!!
 
This is what am getting.

 

The output should be like this, at the same time i want to filter the measures.

 

8 Replies

  • Deku's avatar
    Deku
    Icon for Super User rankSuper User

    You are using Selectedvalue on the measure name, on the grandtotal the measure name is not filtered and you have all three measures in scope, resulting in blank. Therefore you switch goes to the else statment, returning blank

    • Kalaivani's avatar
      Kalaivani
      Icon for Helper III rankHelper III

      Hi Deku Thanks for your response. How to resolve this instead of using switch. Could you please help me create the correct DAX to get the grand totals too? Thanks!

      • Deku's avatar
        Deku
        Icon for Super User rankSuper User

        what would be expected for the grandtotal? the sum of all of the three measures? do grand totals make sense in this situation?

  • v-hashadapu's avatar
    v-hashadapu
    Icon for Community Support rankCommunity Support

    Hi Kalaivani , Thank you for reaching out to the Microsoft Community Forum.

    Please let us know if your issue is solved. If it is, consider marking the answers that helped 'Accept as Solution', so others with similar queries can find them easily. If not, please share the details.
    Thank you.

  • v-hashadapu's avatar
    v-hashadapu
    Icon for Community Support rankCommunity Support

    Hi Kalaivani , Please let us know if your issue is solved. If it is, consider marking the answer that helped 'Accept as Solution', so others with similar queries can find it easily. If not, please share the details.
    Thank you.

  • v-hashadapu's avatar
    v-hashadapu
    Icon for Community Support rankCommunity Support

    Hi Kalaivani , Thank you for reaching out to the Microsoft Community Forum.

     

    Try below example DAX measure (may need tweaking):

     

    SelectedMeasureCompareOptimized =

    IF(

        HASONEVALUE(MeasureSelector[MeasureName]),

        SWITCH(

            VALUES(MeasureSelector[MeasureName]),

            "Wrvus", [PivotWrvusCompare],

            "Wrvus per Visit", [Wrvus per Visit Compare],

            "Deficit Wrvus to 65th %tile", [DeficitWrvus65thcalCompare],

            BLANK()

        ),

        IF(

            ISINSCOPE(MeasureSelector[MeasureName]),

            CALCULATE(

                SWITCH(

                    MAX(MeasureSelector[MeasureName]),

                    "Wrvus", [PivotWrvusCompare],

                    "Wrvus per Visit", [Wrvus per Visit Compare],

                    "Deficit Wrvus to 65th %tile", [DeficitWrvus65thcalCompare],

                    BLANK()

                ),

                ALLSELECTED(ProviderName)

            ),

            BLANK()

        )

    )

     

    In your matrix, keep ProviderName and MeasureName in the Rows, Year-Month in the Columns, and use the updated measure below in the Values. In the Format pane, turn off subtotals for ProviderName (but keep grand totals on). Finally, add a slicer for MeasueSelector[MeasureName] so users can choose between Wrvus, Wrvus per Visit, and Deficit Wrvus.

     

    If this helped solve the issue, please consider marking it 'Accept as Solution' so others with similar queries may find it more easily. If not, please share the details, always happy to help.
    Thank you.

  • v-hashadapu's avatar
    v-hashadapu
    Icon for Community Support rankCommunity Support

    Hi @Kalaivani , Please let us know if your issue is solved. If it is, consider marking the answer that helped 'Accept as Solution', so others with similar queries can find it easily. If not, please share the details.
    Thank you.