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
Anonymous
Not applicable

How to Filter a Matrix Instead of the Underlying Data

Hello,

 

I am hoping someone can help with a problem I've been experiencing recently.  Any guidance is greatly appreciated.

 

I have a visual in PowerBI that involves aggregating/summarizing 2 year's worth of underlying data, where each underlying row contains an Item ID and a few columns of transactional data.  The visual on the front-end shows a summary of those Item IDs and their corresponding transaction Types, based off the time-frame slicer being filtered.

 

The problem is that when I filter to a certain trans type (summary) being >$x, it filters the underlying data and rules out the lines that I want to continue being summarized.

 

The solution (which I don't know how to do, hence my post) is to filter the matrix itself, not the underlying data.

 

Here's what the Matrix Shows:

LocationItemItem DESCRIPTIONSales QtySales $Return QtyReturn $Exchg QtyExchg $
112345Blue Widget-1($13.44)2$26.880$0.00

 

Underlying Data:

LocationDateItemItem DESCRIPTIONSales QtySales $Return QtyReturn $Exchg QtyExchg $
19/12/202012345Blue Widget-1-$13.440$0.000$0.00
12/22/202012345Blue Widget0$0.002$26.880$0.00

 

When I filter the Matrix to Returns >$1, it filters out the total Sales (-1) and shows 0 for that column in the Matrix.  I don't want that, so I would rather filter the Matrix rather than the underlying data.  Is this possible?  Any help is appreciated!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Ok I think I made a work-around.  I created multiple sub-tables based off the master transaciton history table.  One for Sales, one for Returns, and one for Exchanges.  I then made a table showing the Item IDs and Descriptions as a master and linked the tables based of Item ID.  Next, I put the same fields mentioned in my original post into a matrix and now when I filter it seems to work.  

 

@amitchandak  and @v-lionel-msft  thank you for your help but this is what works for me.

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Ok I think I made a work-around.  I created multiple sub-tables based off the master transaciton history table.  One for Sales, one for Returns, and one for Exchanges.  I then made a table showing the Item IDs and Descriptions as a master and linked the tables based of Item ID.  Next, I put the same fields mentioned in my original post into a matrix and now when I filter it seems to work.  

 

@amitchandak  and @v-lionel-msft  thank you for your help but this is what works for me.

amitchandak
Super User
Super User

@Anonymous , one way is to use the visual level filter and filter measure [Return] >0 (say)

 

if you filter a measure , then you use a grouping level. All the measures has to follow this

example

new Return = SumX(filter(Summarize(Table, Table[Location],Table[Date], Table[Item], Table[Item DESCRIPTION], "_1", [Return]),[_1]>0),[_1])

 

new Sales = SumX(filter(Summarize(Table, Table[Location],Table[Date], Table[Item], Table[Item DESCRIPTION], "_1", [Return], "_2",[Sales]),[_1]>0),[_2])

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
Anonymous
Not applicable

@amitchandak thank you for the response but I am not understanding.

 

I tried putting the field in question into the "Filters on this Visual" under the "Filters" tab but when I filter to >$1 it filtered out the underlying lines that contained sales but no returns

 

Regarding the second part of your response, I am a little confused...

 

You said:

new Return = SumX(filter(Summarize(Table, Table[Location],Table[Date], Table[Item], Table[Item DESCRIPTION], "_1", [Return]),[_1]>0),[_1])

 

  • Am I supposed to use this as a Slicer?
  • What does "_1" mean?
  • Why doesn't "[Return]" have the table name before it?

@Anonymous , _1 is new column I am creating in summarize table,

I have assumed you have measure [return] 

 

here on the grouping of these three Table[Location],Table[Date], Table[Item]

the value will be filtered for measure return after the grouping of data >0. You can make 0 as dynamic using slicer 

 

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
Anonymous
Not applicable

Is there any other way to do this?  This isn't working.  Why won't the filter on the visual work as expected?

 

When entering the formula I get the following error and I don't think it would give me what I need anyway. "The syntax for '_' is incorrect."

Hi @Anonymous ,

 

v-lionel-msft_2-1617948217179.png

v-lionel-msft_1-1617948203388.png

I did not reproduce your problem, would you mind sharing a .pbix file?

 

Best regards,
Lionel Chen

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

 

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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.