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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Otrova
New Member

Filtering rows in a matrix by using a Measure and a visual filter

Hello Power Bi community. 

 

I'm currently exploring PBI, and its amazing capabilities. 

 

I did a bit of research and Im able to filter row sin a 'TABLE visual' by using a slicer, a measure and adding a visual filter on the table visual! That works great. 

 

In the snapshot below you can see the slicer (1-3), and in the table below you can see the row selected (that row happens to have a count value of 3.

 

Otrova_0-1691086833051.png

The data is quite simple: All I'm interested is in the partNo and the Date (no need for Ccount). I count how may date per PartNo to obtain Count of Cycle count in picture above.

Otrova_1-1691087045327.png

I also have a table two use with the slicer:

 

Otrova_2-1691087413016.png

 

I Have two measures:

 

Count of Cycle_Count =
     COUNT('Cycle_Count'[Date])
 
Count_Filter =
    VAR MinValue = MIN('Count'[Count_No])
    VAR MaxValue = MAX('Count'[Count_No])
VAR CurrentCountValue = [Count of Cycle_Count]
RETURN
   IF( CurrentCountValue >= MinValue && CurrentCountValue <= MaxValue,1,0)
 
And I use a visual filter:
Otrova_4-1691087763533.png

 

 

As I mentioned, this works great with a Table Visual.

 

Now I'm trying to understand the same scenario but using a MAtrix Visual. I assume it must be a bit more complex because the matrix has two level (PartNo and Date). I would like to achieve the same result, that is filter all PartNo that are in the range of the slicer. But, it does not work. Maybe because a scope issue in the Matrix visual, or because the way the PBI groups the data in the matrix. I'm new at this. 🙂

 

I end up selecting all the rows, while I was expecting to select only PartNo 'B'.  The one with Count_Filter = 1

Otrova_3-1691087706110.png

What is the best approach to follow to obtain the same results while using a Matrix?

Thanks in advanced to any one in the community who could give me a hand in understanding the issue.

 

Not sure how to attach a pbix file, at this time.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Otrova ,

 

Instead of using visual filters, consider use this measure directly.

 

 

Count_Filter = 
    VAR MinValue = MIN('Count'[Count_No])
    VAR MaxValue = MAX('Count'[Count_No])
VAR CurrentCountValue = [Count of Cycle_Count]
RETURN
   IF( CurrentCountValue >= MinValue && CurrentCountValue <= MaxValue,[Count of Cycle_Count])

 

output.

vcgaomsft_0-1691484744628.png

vcgaomsft_1-1691484760396.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Otrova ,

 

Instead of using visual filters, consider use this measure directly.

 

 

Count_Filter = 
    VAR MinValue = MIN('Count'[Count_No])
    VAR MaxValue = MAX('Count'[Count_No])
VAR CurrentCountValue = [Count of Cycle_Count]
RETURN
   IF( CurrentCountValue >= MinValue && CurrentCountValue <= MaxValue,[Count of Cycle_Count])

 

output.

vcgaomsft_0-1691484744628.png

vcgaomsft_1-1691484760396.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Otrova
New Member
foodd
Super User
Super User

Please provide your work-in-progress Power BI Desktop file (with sensitive information removed) that covers your issue or question completely in a usable format (not as a screenshot).

https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

This allows members of the Forum to assess the state of the model, report layer, relationships, and any DAX applied.

thanks @foodd, I was able to include the simple pbix file im using

 

https://drive.google.com/file/d/1SdRrg61WnDUQvAi3fkGPwB_nyhd7Mwra/view?usp=drive_link

 

Thanks

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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