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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Creating a Slicer/Filter based on a Measure used for conditional formatting

Hi there,

 

I have a scatter map built on PowerBI with the colours of the marker being based on an independent measure 

 

Measure :

Color =
SWITCH(
TRUE(),
Currsales> Avgsales && Currev> Avgrev, "#0000FF",
Currsales< Avgsales && Currev> Avgrev, "#FFA500",
Currsales> Avgsales && Currev< Avgrev, "#FFC0CB",
Currsales< Avgsales && Currev< Avgrev, "#FF0000",
"#FFFFFF"
)
 
Scatter Map Values: Product Category (The original data doesnt aggregate the categories so I can't really apply the measure to the data itself)
 
The measure works perfectly. However, I'd like to know if it possible to build a slicer to filter the different coloured categories based on the measure.
 
Thank you in advance 🙂
3 REPLIES 3
AllisonKennedy
Super User
Super User

@Anonymous  This post is an awesome trick that creates a legend, but you can use the same technique to turn it into a slicer instead of legend: https://apexinsights.net/blog/include-legend-with-a-conditionally-formatted-chart 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Anonymous
Not applicable

Hi @AllisonKennedy ,

 

Thank you for your response! While the post is very insightful, there are some key differences that leave me a bit confused as to how to directly apply a similar approach for my case. Firstly, the scatter plot is based on a dataset which is not aggregated (unlike the dataset in the post that you've shared). Also, the scatter plot's X and Y values are also measures so creating a calculated table is rather tricky.  

You don't need to create a calculated table, just need to manually input a table that has the values you want in the slicer. 

 

What options do you want the user to see in the slicer and where in your dataset do those come from?

 

These posts do similar technique, but will again have differences with your scenario: 

https://excelwithallison.blogspot.com/2020/06/dax-approximate-lookup.html

https://excelwithallison.blogspot.com/2021/09/power-bi-forecasting-with-irregular.html 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

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.