Forum Discussion

193's avatar
193
Frequent Visitor
4 years ago

Total in Matrix

Hello guys,

 

is there a way to show a total for all columns? I have matrix with two columns but total is shown only for Actual column:

 

Thank you.

 

5 Replies

  • 193 , I checked, I am getting both measures on my data

     

    Need to know the setting you have to get one. 🙂

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi 193 

        Try this code.

        New_5_Selection_type 193 = 
        VAR _SELECTVALUE =
            VALUES ( 'Target/Actual Selection'[Target/Actual] )
        RETURN
            IF (
                OR ( "Actual" IN _SELECTVALUE, "Target" IN _SELECTVALUE ),
                CALCULATE (
                    SUM ( Data[Revenue] ),
                    FILTER ( Data, Data[Target/Actual] IN _SELECTVALUE )
                ),
                IF ( "Diff." IN _SELECTVALUE, [3 Diff.] )
            )

        By default, total will only show the sum of Actual and Target. I think you don't need the sum of Diff. at this time.

        If you select Target and Actual in Slicer, result is as below.

        If you only select Diff. Total will show sum of Diff.

        Best Regards,
        Rico Zhou

         

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