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 creating a scatter plot with X axis and Y axis are direct columns from the table. In “Values”, I have customer name and customer number. For the legend, I have a calculated measure “persistence” based on selected value of two parameters. Can anyone help on how to use this measure as a legend in scatter plot? This can be done easily in tableau but dont know how to implement in Power BI. But there might be some way to do this. Kindly help me as it is a common use case and can be useful to power bi developers.
Below are the two measures used:
long term = SWITCH(TRUE(),
MIN(table[DL_LT]) <= SELECTEDVALUE(‘lower threshold'[lower threshold]), 1,
MIN(table[DL_LT]) >= SELECTEDVALUE('lower threshold'[lower threshold]), 3, 2)
persistence = SWITCH(TRUE(),
[long term] = [short term], "didn't change",
[long term] > [short term], “improved",
[long term] < [short term], "worse")
Thanks in advance for any help @Mikelytics @visheshjain @Greg_Deckler @amitchandak @Jihwan_Kim
Hi @sharong,
As far as I know you can only use a column in the legends field, so a measure will not work.
Maybe having a dis-jointed table witth your possible measure results MIGHT work, but I am not too sure the approach will work.
Please can you share a PBIX, I'd like to take a dig at it.
Thank you,
Vishesh Jain
Proud to be a Super User!
Hi @visheshjain
Thank you so much for your instant response. I am attaching the pbix file below. Please let me know on the update of this measure as legend if you find the solution or workaround. Thank you.
https://drive.google.com/file/d/18kNyC0aVSnlWf4C72AVJ2ZBBY6npw2B_/view?usp=sharing
Hi @sharong,
I took a quick look at it and wasn't able to get the exact solution to your problem.
However, conditional formatting kinda worked, but still won't show text.
Here is a version of your measure that I used for the conditional formatting of the data points.
Since your upper and lower thresholds are dynamic, we can't even create a calculated column.
I haven't tried the dis-jointed table method yet but will try it tomorrow probably.
Thank you,
Vishesh Jain
Proud to be a Super User!
Thanks for the update @visheshjain please do try dis-jointed table method and let me know if it works better than this conditional formatting method. This conditional formatting of data points satisfies the requirement. I have included
Hi @sharong,
*****EDIT****
Just thought of something, that we can use Query parameters and probably create a calculated column based on that.
This way you lose a little bit of flexibility of the slicer and the report will need to be refreshed, but it just might work the way you want it to. So there is a trade-off.
I need the source excel file aka Sheet1 of your data to make changes to the query, so please share that or a sample file if possible.
*****Edit Over****
I gave it a shot but couldn't get anything to work exactly the way you would have wanted.
Since it is a scatter plot and it accepts only columns, nothing worked.
I also tried to go the Calculation Group route, but didn't work.
Sorry couldn't be of much help here and you are more than welcome to accept one of your own responses as the solution to this post.
Thank you,
Vishesh Jain
Proud to be a Super User!
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 | |
11 | |
10 | |
9 | |
8 |
User | Count |
---|---|
17 | |
12 | |
11 | |
11 | |
11 |