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
DeBIe
Post Partisan
Post Partisan

Can I add a second total to matrix visual?

Hi all,

 

I have a matrix visual with total documents per month per shop. I have the total, but I also would like to add the % of the total at the end of the matrix. I do not want the % of the total to be displayed in every column. Any thoughts on how I can make this happen?

DeBIe_0-1648546894335.png

 

Thank you very much for your time.

 

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @DeBIe ;

Or you could create another table, then create a measure.

1.create a new table.

Newtable = 
var _a=SUMMARIZE( SUMMARIZE('Table',[date],"month",FORMAT([date],"mmmm")),[month])
var _b=SUMMARIZE('Table',"month","Total")
return UNION(_a,_b)

2.create a measure.

Measure = 
var _every=CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),[cate]=max('Table'[cate])&&FORMAT([date],"mmmm")=MAX('newtable'[month])))
var _row=CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),[cate]=max('Table'[cate])))
var _total=CALCULATE( SUM('Table'[Value]),ALL('Table'))
var _col=CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),FORMAT([date],"mmmm")=MAX('newtable'[month])))
return 
SWITCH(TRUE(),
HASONEVALUE('newtable'[month])&&ISINSCOPE('Table'[cate]),IF(MAX([month])="Total",FORMAT( _row/_total,"0.00%"), _every),
HASONEVALUE('newtable'[month]),IF(MAX([month])="Total","100%",_col),
ISINSCOPE('Table'[cate]),_row,_total)

The final output is shown below:

vyalanwumsft_0-1649061956587.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
v-yalanwu-msft
Community Support
Community Support

Hi, @DeBIe ;

Or you could create another table, then create a measure.

1.create a new table.

Newtable = 
var _a=SUMMARIZE( SUMMARIZE('Table',[date],"month",FORMAT([date],"mmmm")),[month])
var _b=SUMMARIZE('Table',"month","Total")
return UNION(_a,_b)

2.create a measure.

Measure = 
var _every=CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),[cate]=max('Table'[cate])&&FORMAT([date],"mmmm")=MAX('newtable'[month])))
var _row=CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),[cate]=max('Table'[cate])))
var _total=CALCULATE( SUM('Table'[Value]),ALL('Table'))
var _col=CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),FORMAT([date],"mmmm")=MAX('newtable'[month])))
return 
SWITCH(TRUE(),
HASONEVALUE('newtable'[month])&&ISINSCOPE('Table'[cate]),IF(MAX([month])="Total",FORMAT( _row/_total,"0.00%"), _every),
HASONEVALUE('newtable'[month]),IF(MAX([month])="Total","100%",_col),
ISINSCOPE('Table'[cate]),_row,_total)

The final output is shown below:

vyalanwumsft_0-1649061956587.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you @v-yalanwu-msft , this will do for now!

Hi @v-yalanwu-msft thanks for this solution. I will try it asap and let you know if it worked. Thanks!

v-yalanwu-msft
Community Support
Community Support

Hi, @DeBIe ;

You could add another masure.

% total = SUM([Value])/CALCULATE(SUM([Value]),ALL('Table'))

Then adjust it.

vyalanwumsft_0-1648797072679.pngvyalanwumsft_1-1648797088413.pngvyalanwumsft_2-1648797152235.png

 

The final output is shown below:

vyalanwumsft_3-1648797161635.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hey @v-yalanwu-msft ,

 

Thank you for your reply and suggest solution. I am wondering how this will be maintainable towards the future. I have the same dashboard live for 15 customers. It means that I need to adjust the column width of the new month every time a new month starts?

 

Thanks

amitchandak
Super User
Super User

@DeBIe , You can have only one total, or based on subtotal . You can not add additional one

 

 

Option are Hybrid table

 

if you are looking for a Hybrid display with Matrix Column and measure
https://community.powerbi.com/t5/Community-Blog/Creating-a-custom-or-hybrid-matrix-in-PowerBI/ba-p/1...
https://community.powerbi.com/t5/Quick-Measures-Gallery/The-New-Hotness-Custom-Matrix-Hierarchy/m-p/...

vote for Hybrid Table
https://ideas.powerbi.com/ideas/idea/?ideaid=9bc32b23-1eb1-4e74-8b34-349887b37ebc

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  thank you for your reply.

 

Do you mean adding a second table/matrix with the same info, except then showing the values as % of the total in the second table? Or do you mean I can quickly switch between % and totals (waiting for report parameters function to do this)

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
Top Kudoed Authors