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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
TotunG
Resolver I
Resolver I

Filter 0 from One Matrix Column Only

Hi,

 

Posted this issue before but still not resolved. I've got the example PBI to help now. (https://drive.google.com/file/d/194BFC7gDw49tSzkBzqz0CJ6MUmxx7H18/view?usp=sharing)

 

I have a Matrix table with Values which appear in 3 categories (Table example below):

 

TotunG_1-1694615989616.png

 

 

 

When displaying this data in a Matrix with Columns as Category and Values as Value it can be seen below. What I would like however, is the Matrix to filter out the 0's that appear BUT only if Category C has a 0 and not if A or B has a 0.  I guess I need some sort of measure to sort this as Advanced Filtering does not work (as filtering 0 removes all instances of 0 from values). The measure I've tried is already in the file and I also tried a calc. column with similar logic.

 

TotunG_0-1694615955051.png

 

Any help would be appreciated.

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@TotunG Perhaps something like:

Complex Selector = 
  VAR __Calculation = CALCULATE( [Measure], [Category] = "C" )
  VAR __Return = IF( __Calculation = 0, 0, 1 )
RETURN
  __Return

Then use the FILTER pane to filter the visual for when this measure equals 1.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Super User
Super User

@TotunG Perhaps something like:

Complex Selector = 
  VAR __Calculation = CALCULATE( [Measure], [Category] = "C" )
  VAR __Return = IF( __Calculation = 0, 0, 1 )
RETURN
  __Return

Then use the FILTER pane to filter the visual for when this measure equals 1.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Think that worked Greg! I definitely need to use variables more - they always help break down the issue...I tend to want to try nest everything haha.

Helpful resources

Announcements
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.