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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
ThomasDay
Impactful Individual
Impactful Individual

color "bubbles" by computed category

In a scatter diagram, there are really nice visual dimensions...the y and x axis, "bubble" size, and color.  I dynamically compute a comparative Percentile Performance Rating for charted points using a measure.  The ratings are text (need not be but are) such as "Q1, Q2, Q3, Q4" for quartile category tags.

 

I'd like to color the "bubbles" by these tags.  In this case, there would be 4 colors, but the best I can do is color saturation which really doesn't help much.  Interestingly I can't drag the PercentileRating to the Play Axis either.  

 

Any tips or advice here?  Here's an example--I'd like to have 4 colors and have that convey a pattern.  Thanks!

Tom

Bubbles.PNG

19 REPLIES 19
asocorro
Skilled Sharer
Skilled Sharer

The Play Axis cannot be a measure, as it acts like a filter to recompute what is charted at each value.  Also, the way to get colors is through the legend.

Connect with me in LinkedIn: https://pr.linkedin.com/in/adolfosocorro
Follow me on Twitter: https://twitter.com/AdolfoSocorro
ThomasDay
Impactful Individual
Impactful Individual

Yes, I should have mentioned I can't get the legend to accept the measure PctileRank either.  So what can be done?

ThomasDay
Impactful Individual
Impactful Individual

Hello again--the main question is can scatter diagram colors be set with a dynamic measure?  Anyone have experience with this or a way to work around the limit?

This might give you a new approach: http://prologika.com/power-bi-measure-dimensions/

 

Connect with me in LinkedIn: https://pr.linkedin.com/in/adolfosocorro
Follow me on Twitter: https://twitter.com/AdolfoSocorro
ThomasDay
Impactful Individual
Impactful Individual

That's an interesting approach.  In essence, a measure is written to a column.  

 

In my example, the points to be "banded" into percentiles will be dynamic--based on slicers.  For example, from a group of 5,000 facilities, a user might choose a certain size, a certain geographic location, a certain ratio of fte's/patient and so on.  Once a group is selected, their bands are computed from the selection--meaning it's going to change on a 'click.'  Then the user might continue to explore...and make a new selection...and on another page there will be another chart etc.

 

Is it possible to write the buckets to a scratch lookup table?  As I ask that I really don't know how I'd keep the bucket "results" for a dozen charts, say, and all their related slicer activity filtered properly on a dynamic basis.  Thoughts?

ThomasDay
Impactful Individual
Impactful Individual

Per the link above from @asocorro, I have been looking at the idea of using ADDCOLUMNS as a possible way to write a table--with a key column and then the Percentile column with the idea of using it as a legend to color buckets...I can do the addcolumn as I compute the percentile measure.

 

I'm puzzled by this wording in the definitive DAX book so am having a hard time knowing what exactly happens with ADDCOLUMNS: "The result of the computation is not persistent to the data model"

 

I'm looking to use this new column as coloring legend in a visualization--don't want the result to be persistent beyond the visualization--so it sounds promising but I have no idea what that means or how long it persists--or when it gets extinguished.

 

Anyone provide a simple explanation or better--any place I can read up on the mechanics of this stuff..it's a bit mysterious?  I'll just try it out later--but that it would be nice to get some grounding. 

 

Thanks in advance,

Tom  

Sean
Community Champion
Community Champion

@ThomasDay I remember your example - luckily I still had my test file

 

Is this what you are trying to achieve? If so just copy my setup Percentile.png

ThomasDay
Impactful Individual
Impactful Individual

Yes, that is what I'm looking to do.  I'll take a look when I get back to the house!  Tom

Sean
Community Champion
Community Champion

Ok here it is again a bit improved...

 

Percentile 3.png

ThomasDay
Impactful Individual
Impactful Individual

@Sean--I am still unable to use my PctileCateg as a legend.  Here's a screenshot of my visual.  Dragging PctileCatg onto the legend is not being permitted....which is where this all started.  Do you mind sharing your Percentile code...it must be different somehow.  Mine is a measure and attached to a table that is basically a holder/container for all my measures.  Tom

Sean
Community Champion
Community Champion

@ThomasDay 

I create 2 Calculated Columns to achive this - TotalPorfitColor AND PercentileColor - same formulas as the Measures

I then use the PercentileColor Column in the Legend - You should of course change the names to something better

Percentile 4.png

 

First TotalProfitColor Column

Percentile - Step 1.png

Then PercentileColor Column because you reference TotalProfitColor

Percentile  - Step 2.png

And I use this Column in the Legend.

I know it seems you are doing the same thing twice once for Measures once for columns

but since you can't place Measures in the Legend field I don't see another way to do this.

Let me know if it works.

ThomasDay
Impactful Individual
Impactful Individual

@Sean Thanks for this.  Here's the rub as I see it.  I will have many different "performance groups" on many different pages--so there's not one "master list" of performance percentiles...it's dynamic.  So, I'm wondering if using AddColumns creates a dynamic "table and column" when I put it in a visualization--with each visualization creating their own added percentile column (and key column combination.)  Would be fine it it extinguished when the file is closed, and recreated when the visualization is reopened.  

 

If that's what happens, that would work great.  Any thoughts?  Tom

Sean
Community Champion
Community Champion

@ThomasDay @Greg_Deckler @Seth_C_Bauer @austinsense

 

Yes I noticed you were using a different Size Measure and thought about this...

 

I don't see why we can't place Measures in the Legend?

 

Maybe someone could tell us why Measures are not allowed in the Legend of a Bubble Chart?

ThomasDay
Impactful Individual
Impactful Individual

@ImkeF  I know you're not on this thread...but is there a reason I can't use a measure in a legend for a scatter diagram?  And does AddColumn allow me to create, in essense, scratch tables that float on their own until they are extinguished or the power bi closed?

 

Those of us on this thread...we're kind of stuck!  Any ideas?

Hi Tom,

Sorry, no idea. Never used this chart type.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Sean
Community Champion
Community Champion

@ThomasDay What happened with this issue? How and did you resolve it?

ThomasDay
Impactful Individual
Impactful Individual

Hello @Sean--Thanks for checking in.  I've been unable to solve without a calculated column like your solution.  I did get some very interesting links from @Seth_C_Bauer that put these sorts of issues in a nice context or pattern: Dynamic Patterns and DAX patterns that have given me ideas on how to construct a very useful bunch of segments--static in that they are from the underlying data rather than a selection.  I still would like to figure out how to display a computed measure as a legend...but for the minute I'm working around the issue and these patterns are worth a read.  Tom

Sean
Community Champion
Community Champion

@ThomasDay Thanks for the update and the links! I'll definitely have to explore some of those patterns as well.

They can't, and I am not sure what it would mean.  The dots on the scatter chart are already representations of measures, so I don't know what it would mean to have measures calculated based on each one.

Connect with me in LinkedIn: https://pr.linkedin.com/in/adolfosocorro
Follow me on Twitter: https://twitter.com/AdolfoSocorro

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.