Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi! I am trying to built a dashboard for client presentations and have built the below chart where you have one dot for each client. When speaking to a client we are not allowed to show by name where the other clients lie in the chart but would like to show them where they lie compared to their peers in order to benchmark themselves. Therefore, I would like to every time colour the client we present to with say red and all the others with the same colour say black. We have multiple charts like that so we cannot change the legend colours manually every time. Is there an easy way to do conditional colouring in scatter plots?
Thank you very much, really appreciate any help on this!
Solved! Go to Solution.
Hello @nefeli_ef
You can use conditional formatting in the scatter plot.
I build a sample table for testing.
My table:
Then I build a client table. Create a slicer next to this table.
Client = values('Table'[Client])
My measure:
Color =
VAR _Sel = SELECTEDVALUE(Client[Client])
Return
IF(MAX('Table'[Client])=_Sel,1,0)
Add this measure to the data color in Format.
The result is as follows. By default, all points will be black, when we select a customer in the slicer, the selected customer point will be red and others in black.
You can download the pbix file from this link: Dynamic Conditional Colouring in Scatter Plots
Best regards
Rico Zhou
If this post helps,then consider Accepting it as the solution to help other members find it faster.
Hello @nefeli_ef
You can use conditional formatting in the scatter plot.
I build a sample table for testing.
My table:
Then I build a client table. Create a slicer next to this table.
Client = values('Table'[Client])
My measure:
Color =
VAR _Sel = SELECTEDVALUE(Client[Client])
Return
IF(MAX('Table'[Client])=_Sel,1,0)
Add this measure to the data color in Format.
The result is as follows. By default, all points will be black, when we select a customer in the slicer, the selected customer point will be red and others in black.
You can download the pbix file from this link: Dynamic Conditional Colouring in Scatter Plots
Best regards
Rico Zhou
If this post helps,then consider Accepting it as the solution to help other members find it faster.
@Anonymous , make sure you have an independent client table to color the dot. and Client is not use as legent
Measure =
var _cli = maxx(allselected(Indclient),Indclient[Name])
return
if(max(clinet[client]) =_cli , "Red","Green")
Use this in conditional formatting with field value options.
refer for steps
https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-numbers-in-the-column
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values
Also refer: https://youtu.be/Q1vPWmfI25o
Thank you for the response. I have created a table with the Client Names and tried this but I can't get it to work. Can you please have a look at my formula? I get an error saying "Too few arguments were passed to the MAXX function. The minimum argument count for the function is 2." I only have one column I will be filtering in which is the Client List.
I adapted your formula to my table where:
Unique Clients: Table of Client List
Client Aliaslast: Column with Client Names
Can you please tell me what is wrong?
Thank you!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |