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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ivan_larson_cki
Helper III
Helper III

Matrix not Filtering by Higher-Level Query

I have a matrix showing various measures calculating sales for specific products. The products are listed as rows, and are broken out from categories. I have a higher-level Category query that i need for other visuals, but one of its functions is to slice this matrix. I only want to see the rows of the matrix that are relevant after applying the category slicer. How do I make this happen?

 

Current Visuals:

Current Visuals.png

How it currently appears when sliced ("Hardware" and its associated rows should be hidden):

Currently Sliced.png

 

Categories:

CategorySales Target
Food1000
Hardware800

 

Product Data:

CategoryProduct
FoodBurger
FoodPizza
HardwareComputer
HardwareDesk
FoodMilk

Measures on Product Table:

Sales by Alpha = 0+CALCULATE(SUM(Sales[Amount]),FILTER('Sales','Sales'[Sales Person]="Alpha"))
Sales by Beta = 0+CALCULATE(SUM(Sales[Amount]),FILTER('Sales','Sales'[Sales Person]="Beta"))
Sales by Gamma = 0+CALCULATE(SUM(Sales[Amount]),FILTER('Sales','Sales'[Sales Person]="Gamma"))
Sales by Delta = 0+CALCULATE(SUM(Sales[Amount]),FILTER('Sales','Sales'[Sales Person]="Delta"))
Sales Total = 0+CALCULATE(SUM(Sales[Amount]))

 

Sales Data:

ProductAmountSales Person
Burger20Alpha
Pizza40Alpha
Computer60Alpha
Desk50Alpha
Milk70Beta
Burger70Beta
Pizza30Beta
Computer80Beta
Desk60Gamma
Milk30Gamma
Burger50Gamma
Pizza40Gamma
Computer60Delta
Desk30Delta
Milk70Delta
9 REPLIES 9
smpa01
Super User
Super User

@ivan_larson_ckithis is the direction of your table

 

sqwq.PNG

 

which means the expanded table in DAX does

left outer with

categories to products

and

Categories-Products does left outer with Sales

 

dews.PNG

Bring Category from category table and Product from Product Table in the matrix

For slicer bring category from Category table it should be able to slice

X.gif

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Hi @smpa01,

 

Thank you for your suggestion. In your matrices, food products are listed under hardware, and hardware products are listed under food. Is there a way to prevent that in the structure you're suggesting?

Please change  to

Sales by Alpha = CALCULATE(SUM(Sales[Amount]),FILTER('Sales','Sales'[Sales Person]="Alpha"))
or
use
Alpha = CALCULATE(SUMX(Sales,Sales[Amount]),FILTER(Sales,Sales[Sales Person]="Alpha"))
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
amitchandak
Super User
Super User

Please check if the interaction is not switched off

Interactions.png

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin

Hi @amitchandak ,

 

Thank you for your response. Interaction is on.

Interaction A.pngInteraction B.png

 

Also, here are the table relationships:

Relationships.png

hi @ivan_larson_cki 

If [Category] in the slicer is from 'Categories' table? try to use 'Categories'[Category] to create a slicer and try it again.

If you still have the problem, could you please share your sample pbix file for us have a test, there should be something wrong in other.

You can upload it to OneDrive and post the link here. Do mask sensitive data before uploading.

 

Regards,

Lin

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

Yes, the slicer is pulling from 'Categories'[Category].

 

I found a solution by switching the slicer to 'Products'[Category] and setting the cross-filter direction to "Both" on the relationship between 'Products' and 'Categories'. I realize using cross-filter directioning set to "Both" is not ideal, but I haven't noticed a substantial increase in load times yet.

hi  @ivan_larson_cki 

Could you please share your sample pbix file for us have a test? there should be something wrong in others.

 

Regards,

Lin

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

Hi Lin,

 

Our organization's security settings don't allow sharing one drive files externally. Is there another way I can share it?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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