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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
SteveMciver
New Member

Dynamic Filtering Based On Other Column Data

 

Hello, I have a dataset structure similar to the below. My users need to be able select a variable in the report and have that variable compared to benchmarked data for variables of the same type - ideally in the same chart (though could be two charts side by side). 

I am struggling to find a way around the fact that once the page is filtered to the variable, the benchmark data is filtered out. I believe this could be overcome with a separate table, but that stops both the variable and benchmark data from being filtered by other data.

 

Here's a scenario for what I want to do using the dummy data:

- Select the Golden Delicious apple varitey from a table or slicer

- Have a chart update to show the 'Review Score' distribution for Golden Delicious vs the reveiw score distibution for all apples that are the same 'Type' (so green in this scenario) and 'Benchmark' = Yes.

- Filter the chart further to show the 'Review Score' distribution for both Golden Delicious  and the benchmarked 'Type' data for those under the age of 50 who live in the US. 

 

There are too many varieties to hard code the potential variables in the actual dataset.

 

Thanks for your help!

 

Tasted Apple UIDApple VarietyTypeReview ScoreReviewer AgeReviewer CountryBenchmark
121566Granny SmithGreen520GermanyYes
543543Pink LadyRed345USYes
57454541Golden DeliciousGreen623USNo
313245Granny SmithGreen467FranceYes
543543Red deliciousRed118JapanNo
545465Pink LadyRed663BrazilYes
21321Granny SmithGreen836MexicoYes
54451Golden DeliciousRed432UKNo
5454545Red deliciousRed350FranceNo
475545Red deliciousRed541UKNo
54545Granny SmithGreen134UKYes
5454Golden DeliciousGreen743GermanyNo
1 ACCEPTED SOLUTION
v-angzheng-msft
Community Support
Community Support

Hi, @SteveMciver 

Based on what I got, you can follow the following steps.
Step 1: Create calculated table summary variety, type Benchamark fields, and create slicers with the summarized fields
Step 2: Try creating the following measures to filter the items.

Condition1 = 
var _Variety=SELECTEDVALUE(Variety_Type[Apple Variety])
var _type=SELECTEDVALUE(Variety_Type[Type])

var _currentVariety=MAX('Table'[Apple Variety])
var _currentType=MAX('Table'[Type])
var _currentBenchmark=MAX('Table'[Benchmark])

var _if=IF(_currentVariety=_Variety&&_currentType=_type,1,IF(_currentType=_type&&_currentBenchmark="Yes",1,0))

return _if
Condition2(further) = 
var _Variety=SELECTEDVALUE(Variety_Type[Apple Variety])
var _type=SELECTEDVALUE(Variety_Type[Type])
var _Benchmark=SELECTEDVALUE(Variety_Type[Benchmark])

var _currentVariety=MAX('Table'[Apple Variety])
var _currentType=MAX('Table'[Type])
var _currentBenchmark=MAX('Table'[Benchmark])

var _if=IF(_currentVariety=_Variety&&_currentBenchmark=_Benchmark&&MAX('Table'[Reviewer Age])=50&&MAX('Table'[Reviewer Country])="US",1,0)

return _if

Step 3: Then filter the items with measure equal to 1 in the filter pane.

 

Result:

vangzhengmsft_0-1646110299801.png

Please refer to the attachment below for details.

Hope this helps.

 

 

Best Regards,
Community Support Team _ Zeon Zheng


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

2 REPLIES 2
v-angzheng-msft
Community Support
Community Support

Hi, @SteveMciver 

Based on what I got, you can follow the following steps.
Step 1: Create calculated table summary variety, type Benchamark fields, and create slicers with the summarized fields
Step 2: Try creating the following measures to filter the items.

Condition1 = 
var _Variety=SELECTEDVALUE(Variety_Type[Apple Variety])
var _type=SELECTEDVALUE(Variety_Type[Type])

var _currentVariety=MAX('Table'[Apple Variety])
var _currentType=MAX('Table'[Type])
var _currentBenchmark=MAX('Table'[Benchmark])

var _if=IF(_currentVariety=_Variety&&_currentType=_type,1,IF(_currentType=_type&&_currentBenchmark="Yes",1,0))

return _if
Condition2(further) = 
var _Variety=SELECTEDVALUE(Variety_Type[Apple Variety])
var _type=SELECTEDVALUE(Variety_Type[Type])
var _Benchmark=SELECTEDVALUE(Variety_Type[Benchmark])

var _currentVariety=MAX('Table'[Apple Variety])
var _currentType=MAX('Table'[Type])
var _currentBenchmark=MAX('Table'[Benchmark])

var _if=IF(_currentVariety=_Variety&&_currentBenchmark=_Benchmark&&MAX('Table'[Reviewer Age])=50&&MAX('Table'[Reviewer Country])="US",1,0)

return _if

Step 3: Then filter the items with measure equal to 1 in the filter pane.

 

Result:

vangzhengmsft_0-1646110299801.png

Please refer to the attachment below for details.

Hope this helps.

 

 

Best Regards,
Community Support Team _ Zeon Zheng


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

MFelix
Super User
Super User

Hi @SteveMciver ,

 

Not really sure If understand what you need but maybe you can use the interactions between the visualizations to get the values you need, so the apple variety only changes the values of a single chart (the one to benchmark) then create a slicer for each of the olther columns that will only interact with another chart, be aware to select the Benchmark also to filter.

 

Then just change the slicers and the second chart will change accordingly, if you want it to be in the same chart then this needs to be done with disconnected tables.

 

Chek PBIX file attach and please get back to me if this is not the expected result.

 

The chart on the left only interact with the slicer on the left and the ones on the right with the slicers on the right.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.