Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
193
Frequent Visitor

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:

193_0-1632402105860.png

 

Thank you.

 

5 REPLIES 5
amitchandak
Super User
Super User

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

 

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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi, Amitchandak,

 

I attach an example:

https://www.dropbox.com/s/v5zjo7dck99zdx6/Example.pbix?dl=0

 

Thank you.

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.

2.png

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

1.png

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

3.png

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.

193
Frequent Visitor

Thank you for your answer, RicoZhou,

 

 

but it is not what I want to accomplish. I want to have Total Column for each Target, Actual, Diff and Diff %.

 

Thank you.

Anonymous
Not applicable

Hi @193 

Due to your data model, you could only get only one Total column in Matrix visual. My code will give you correct Total for each Target, Actual, Diff and Diff %. If you select multiple selections, it will give you sum of all selection you selected.

 

Best Regards,
Rico Zhou

 

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

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors