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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
vojtechsima
Resident Rockstar
Resident Rockstar

Matrix - Total to All when filtered

Hi, guys,
I am quite struggling with this one:
I need this table:

BUSomethingTotal by BUTotal by ItemTotal by selected BU
Elle5500706892765008608966
Louis1000154003965008608966
Total6500860896665008608966


I need to get the Total of "Total by BU" to Total by selected BU. 
I am able to retrieve the Total By BU using this measure:

 

 

var __SelectedBUs = VALUES('sample'[BU])

var __calc = CALCULATE(SUM('sample'[Something]),ALL('sample'[Item],'sample'[BU]), 'sample'[BU] IN __SelectedBUs)

 

 

However, I can't figure out how to put the total to All rows in the next column.
There's an active "Item" slicer:

vojtechsima_0-1646739518984.png


What it should do is that it takes all "BUs" that is filtered by "Item", then toss the "Item" filter out, SUM(Something) of all the filtered BUs together and return it back to all rows. Similar to "Total By BU" but return the total to all rows.

1 ACCEPTED SOLUTION

Hi, @amitchandak 
I am a bit embarrassed that I didn'T figure this out, however, I managed to fix it by referencing the previous measure and adding the ALL filter.

var __calc = CALCULATE('sample'[AllexceptBU], ALL('sample'[BU]))
return __calc

However, I appreciate your time and effort. Thank you

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@vojtechsima , try if one of the two can help

 

var __SelectedBUs = VALUES('sample'[BU])

var __calc = CALCULATE(SUM('sample'[Something]),Keepfilters('sample'[BU] IN __SelectedBUs)

or


var __SelectedBUs = VALUES('sample'[BU])

var __calc = CALCULATE(SUM('sample'[Something]),'sample'[BU] IN __SelectedBUs)

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hi, @amitchandak 
I am a bit embarrassed that I didn'T figure this out, however, I managed to fix it by referencing the previous measure and adding the ALL filter.

var __calc = CALCULATE('sample'[AllexceptBU], ALL('sample'[BU]))
return __calc

However, I appreciate your time and effort. Thank you

Hi, @amitchandak 
Unfortunately, this gives me something that I already did in previous tries, I am still not getting the same result for all rows in my matrix.
I need to have the sum of mentioned BUs in all rows (the same value) and I also need to filter out the "Item" slicer.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.