cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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.

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.

I also have a table two use with the slicer:

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:

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

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
Community Support

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.

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

4 REPLIES 4
Community Support

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.

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

New Member
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.

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

New Member

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

Thanks

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.