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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
mikegil
New Member

Filter Context appears to be different for Vizualization Filter than row in Matrix

I am trying to create a Matrix in which some rows appear based on the value of one of their fields relative to the average for this field in the set of selected rows (controlled by slicers on that page).  A simplified version of my controlling column might be:

 

Is LP := IF([LP%] < [Selected LP%],1))

 

where Selected LP% is a value pulled from a slicer on a parameters table (say .9) and LP% is defined as some thing like:

 

LP% := VAR globalAvg = CALCULATE(AVERAGE('table'[interestingField]),ALLSELECTED()) RETURN 'table'[interestingField]/globalAvg

 

LP% and Is LP calculate just as I expect in the matrix, but if I set a Visualization Filter on Is LP to show only where it is 1, a different set of rows gets show vs. those that have a 1 in that column.  Despite the filter clearly say "Show items when the value is 1", rows are shown which have a value of 0 and it appears that some rows that should have a 1 are hidden.   I checked that this visualization filter wasn't being calculated in the Filter Context before any of my Slicers by changing the LP% formula to use ALL instead of ALLSELECTED.  I obviously get different answers as you would expect, as the globalAvg is now the average for the whole dataset without regard to the Slicers, but it is still a different set of rows that get marked with Is LP = 1 than get hidden by the visualization filter when I use ALLSELECTED.  The row value and the hidden/show rows are now in sync, so clearly it is a difference in how ALLSELECTED is being handled.  

 

I know that ALLSELECT only actually moves "back one step" in that the Row Filter is removed exposing what was the Table Filter as you enter the CALCULATE, what is throwing me is why the Visualization Filter has a different context and what I need to do to avoid falling into this trap.

 

It is probably just that I am new to this and not seeing the obvious, but if anyone has walked through this issue before and can point me in the right direction I'd be most grateful.

 

 

1 REPLY 1
v-sihou-msft
Microsoft Employee
Microsoft Employee

@mikegil

 

In this scenario, your LP% calculation is from current row context. I don't think it's possible to use the result of "Is LP" which has dependency on "LP%" to limit the row context  within matrix. 

 

Can share some sample data and your expected result?

 

Regards,

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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
Top Kudoed Authors