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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
bostewart_key7
New Member

Change Matrix Grouping With Slicer

I'm trying to allow my users to dynamically choose a group by option for the matrix control.   As an example I have sales data that is categorized by 2 different attributes, Location and Reporting Category.    These 2 attributes are not related so placing them in a hierarchy does not produce the desired result.  Ideally I'd like the Rows grouping in the matrix to be able to update based on a value selected from a slicer, where the slicer has 2 options (Location and Reporting Category).    So the data might look something like:

 

When grouped by Location (selected in the slicer):

Location    Amount

Loc 1         100.00

Loc 2         150.00

Total          250.0

 

When grouped by Reporting Category (selected in the slicer):

Reporting Category     Amount

Cat A                            75.00

Cat B                            125.00

Cat C                            50.00

Total                             250.00

 

I am stuck on how best to accomplish this in PowerBI.

1 REPLY 1
v-yuezhe-msft
Employee
Employee

@bostewart_key7,

Do you have a sales fact table? If so, you would need to create proper relationships between fact table and Dimension table and filter option table in order to dynamically change the attribute. You can follow the guide in the blog below to achieve the requirement. If you have any questions about DAX, please share the sample data of your fact table to us.

https://www.tringuyenminh92.com/index.php/2017/10/03/dynamic-change-dimensions-in-power-bi/ 

Regards,
Lydia

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

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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