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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
xhurit
Frequent Visitor

DAX ignore row filter context, keep filters from slicer

Hello,

 

I have a visual with table that represents sales on Month-Customer-Product level. I need to create a measure that will display how many products were selected in Product slicer. The tricky part is that I need to show it in the table visual as well but the problem is that when I put my measure in the table, it is being evaulated at row level therefore it is limited to only one product. At first I tried with:

 
COUNTROWS ( VALUES ( 'DIM Product'[Material Name] ) )
 

But it always shows 1 for each row. Then I tried:

 

COUNTROWS ( ALLSELECTED ( 'DIM Product'[Material Name] ) )

 

and this time it is showing how many products for each customer and month are available in my Fact table. 

 

What I actually want it to show is 3 in every row, just like in card visual. So as I understand it correctly logic for this measure should be to ignore product filter from visual (row filter) and keep product filter from slicer. I can't use ALL function becasue it will erase selection from slicer as well. Is it possible in DAX to create such a measure?

 

PBIforum.png

Thanks in advance for any response!

 

 

1 ACCEPTED SOLUTION

Hi @xhurit ,

Sorry for replying late. Based on your description, you need to create a seprate slicer table like this:

Product slicer = DISTINCT('Table'[Product])

Then create your measure to count:

Count = COUNTROWS(ALLSELECTED('Product slicer'[Product]))

To interact with the source table, you can create the relationship between two tables based on the product column and set the table visual filter like this:

tb.png

Attached a sample file in the below, hopes to help you.

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
lbendlin
Super User
Super User

Usually in such a scenario you use disconnected tables to break out of the filter context, and then apply the filters manually via the measure.

@lbendlin can you elaborate on this? Should I duplicate Product table? What measure should I use then? Which table will be used as a slicer then? 

Hi @xhurit ,

Sorry for replying late. Based on your description, you need to create a seprate slicer table like this:

Product slicer = DISTINCT('Table'[Product])

Then create your measure to count:

Count = COUNTROWS(ALLSELECTED('Product slicer'[Product]))

To interact with the source table, you can create the relationship between two tables based on the product column and set the table visual filter like this:

tb.png

Attached a sample file in the below, hopes to help you.

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Count = COUNTROWS(ALLSELECTED('Product slicer'[Product]))

can be reduced to 

Count = COUNTROWS('Product slicer')

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.

Top Solution Authors