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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
psorel
Helper I
Helper I

Filter a matrix visual with values of measure

Hi, 
I created a matrix visual with differents groups in first column and count and sum measures after. 
I don't understand why i can't filter on measure >0 for delete rows with 0. 
I tried a "test_filter" measure if( [nb noubeaux mandats] >0,1,0) i got 0 everywhere. 
I don't have all or allexcept functions in measures.
Can u help me ?


Capture d’écran 2024-12-03 110638.png

6 REPLIES 6
psorel
Helper I
Helper I

In my case it's a measure for each column and different data type, can i filter all the row if just one value  " [nb noubeaux mandats" in my case , is > 0 .  I filter all my measure on the max(start month date) . Thanks

Laxmanjatoth
Resolver I
Resolver I

are you using any time intelligence functions or anythink else ?

danextian
Super User
Super User

Hi @psorel 

That is because the filter is applied to the total column and not to every cell in your matrix. In the screenshot below, Table2 is filtered to have a value  > 0 but it did not filter out the second row because the total for that row is 2 and not 0

danextian_0-1733223736198.png

If you want those  with 0 disappear, return them as blank in a measure

My Measure =
VAR _val = SUM ( 'Table'[Value] ) RETURN IF ( _val = 0, BLANK (), _val )

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Anonymous
Not applicable

Hello,danextian and Laxmanjatoth ,thanks for your concern about this issue.

Your answer is excellent!
And I would like to share some additional solutions below.
Hi,@psorel .I am glad to help you.
Like this?

vjtianmsft_0-1733387383243.pngvjtianmsft_1-1733387408138.png

vjtianmsft_2-1733387441899.png

Note that I didn't put any fields in the Columns field, the Rows filed puts the [ID] column, and the Values field puts the measure of the data being displayed.

vjtianmsft_3-1733387513931.png

This is my test data:

vjtianmsft_4-1733387529509.png
the measure I create.

M_DateDiff = 
VAR _date =MAX('matrixTest'[Date])
VAR _maxTotal =CALCULATE(MAX('matrixTest'[Date]),ALL(matrixTest))
RETURN
DATEDIFF(_date,_maxTotal,DAY)

M_MaxGroupName = MAX('matrixTest'[GroupName])

M_SumSales = SUM('matrixTest'[DailySales])

test_filter = IF([M_SumSales] > 0 ,1,0)


If my understanding is off, please keep me informed and attach more information or provide the pbix test file (shared on the forum via a github link) that doesn't contain sensitive data This will help to resolve your issue.

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian,

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

That will work with matrix without a field on the columns tile. Following that approach, OP might as well use a table instead of a matrix. But, what if  for example, ID 1 has both A and B? Since GroupName value is being returned using a measure using MAX, A now disappears.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Anonymous
Not applicable

Hi,@danextian .
Thank you very much for the heads up.

Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

May 2025 Monthly Update

Fabric Community Update - May 2025

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