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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

How to work with different filter context: ignore row/column level filter but keep slicer

Hi Power BI geniuses out there,

 

I'm currently working on a measure where I am trying to create a matrix for each category and brand with relative scores. I have been struggling with this for as long as I can remember. The raw data table looks like this:

 

PersonIdCountryBrandCategoryScore
13111
13120
13131
13140
13150
1321

1

The measure works as follows:
- calculate average score for each category/brand
- calculate the column total score for a brand

- calculate the row total score for category

- sum all the row total (or column total scores, doesnt matter it will be the same) for category

relative score is = average score - weighted score
where weighted score = column total*row total/all row(or column) totals
see example below:

   Brands  
  brand 1brand 2brand 3 
 category 1605010120
Categoriescategory 2403045115
 category 330203585
 sum13010090row total sum
     320
      
   Brands  
  brand 1brand 2brand 3 
 category 1each cell = (relevant row level sum - relevant column level sum ) /  total sum of all rows 
Categoriescategory 2 
 category 3 
      

Now I have created some measures to calculate row/column totals with the following methodology, example for all the score for attributestotals:

 

 

sum of all attributes = CALCULATE(Sumx(summarize(Table, Table[BrandId], Table[Category], "_avg", Average(Table[Score])),[_avg]),ALLEXCEPT(Table,Table[Category]))

 

 


However, this measure only works if I don't apply any filters. Now for example if I want to apply a filter on the country, it will calculate using all category scores and all brands scores. Ofcourse not all categories are in all countries and all brands in all countries. I am wondering if there is a way for me to set up this measure so it will still work with a country level filter? I have been struggling with this measure for so long so I would appreciate any help. In essence I am trying to ignore the row and column level context of the matrix in which the measure is placed in as a value, but still be able to slim the dataset down on country level as a filter. Any help is appreciated so much!

 

Kind regards,

 

Deniz
.

4 REPLIES 4
v-xiaotang
Community Support
Community Support

Hi @Anonymous 

Not very sure. I create a sample according to your description, could you show your expected result based on the sample? So that we can write a measure for you.

vxiaotang_0-1637134879986.png

Best Regards,

Community Support Team _Tang

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

lbendlin
Super User
Super User

Two comments:

- ALLEXCEPT removes ALL filters EXCEPT the category filters.  Including your Country filter.  Likely not what you want.

- SUMMARIZE is dangerous-ish.  It may not do what you think it does. All the secrets of SUMMARIZE - SQLBI

Anonymous
Not applicable

Thanks for the heads up - would you be able to help me rewrite the measure? I am not sure which other avenues are left 

Please provide sanitized sample data that fully covers your issue.  Please show the expected outcome.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.