Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I am working with a bunch of entities, and conducted a ML project. Some entities emerged as outliers and are cathegorised as flagged, the rest is unflagged.
I have a table with entity number and name, which should drive a scatterplot.
In this scatterplot I have two options on the x axis, that is flagged and not flagged.
When I select an entity on the table I wanted this entotu to be highlighted in the scatterplot along with all other entities- which should appear in a dim colour. I tried the below code, and use it in Legend. However, I simply cannot get it working properly. I also cannot use Marker, It does not show up the conditions noted below as in selction and flagged versus non flagged.
Does anyone know of a similiar example?
VAR SelectedEntities = ALLSELECTED(FAP_RegReturn_PowerBI_T3[FSP Number]) // Selected entities in slicer
VAR ThisEntity = 'FAP_RegReturn_PowerBI_T3'[FSP Number]
VAR IsSelected = CONTAINS(SelectedEntities, [FSP Number], ThisEntity)
VAR IsFlagged = 'FAP_RegReturn_PowerBI_T3'[Final_Outlier] = TRUE()
RETURN
SWITCH(
TRUE(),
IsSelected && IsFlagged, "Dark Grey", // Selected & Flagged
IsSelected && NOT IsFlagged, "Dark Green", // Selected & Not Flagged
NOT IsSelected && IsFlagged, "Light Grey", // Not Selected & Flagged
NOT IsSelected && NOT IsFlagged, "Light Green" // Not Selected & Not Flagged
)
Solved! Go to Solution.
Hi @acg
Thank you for reaching out to the Microsoft fabric community forum.
You can solve this by creating a separate table for selecting the entity, so it doesn’t filter the main data. Then use a DAX formula to set colours based on which entity is selected and whether it's flagged or not. This way, all entities will always show in the scatterplot selected one in dark colour, others in light colour. Just use EntityColor in legend, and FlagStatus on X-axis and Score on Y-axis. It will work exactly like you want.
Instead of using a table, I suggest using a slicer to select the entity. It will help show all entities in the scatterplot with correct highlight and color logic as you expected.
I tested it with my sample data, and it worked fine. Please find the attached Pbix for your reference and gothrough with this link it may help you regarding issue:
Solved: Change color of scatter depending on selection fro... - Microsoft Fabric Community
I hope this helped Feel free to ask any further questions. If this resolved your issue, please mark it as "Accept as Solution" and give us Kudos to assist others.
Regards,
Harshitha.
Hi @acg
Thank you for reaching out to the Microsoft fabric community forum.
You can solve this by creating a separate table for selecting the entity, so it doesn’t filter the main data. Then use a DAX formula to set colours based on which entity is selected and whether it's flagged or not. This way, all entities will always show in the scatterplot selected one in dark colour, others in light colour. Just use EntityColor in legend, and FlagStatus on X-axis and Score on Y-axis. It will work exactly like you want.
Instead of using a table, I suggest using a slicer to select the entity. It will help show all entities in the scatterplot with correct highlight and color logic as you expected.
I tested it with my sample data, and it worked fine. Please find the attached Pbix for your reference and gothrough with this link it may help you regarding issue:
Solved: Change color of scatter depending on selection fro... - Microsoft Fabric Community
I hope this helped Feel free to ask any further questions. If this resolved your issue, please mark it as "Accept as Solution" and give us Kudos to assist others.
Regards,
Harshitha.
Excellent, thank you!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
6 | |
6 | |
2 | |
2 |
User | Count |
---|---|
4 | |
4 | |
3 | |
3 | |
2 |