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
HamidBee
Impactful Individual
Impactful Individual

How do I create a conditional colour rule in Charticulator?

Hi Everyone,

 

I am trying to create a conditional colour rule in Charticulator that says if the value is greater than zero 'green' and if it is less than zero, 'red'. I think I the only way to do this would be to create a measure that splits the values into two categories, positive and negative. I was just wondering if anyone knows if there is another way.

 

In the video I saw the person did the following but I can only assume 'value type' here is another category which categorises the categories based on there values. Essentially a measure. Any ideas?

 

ezgif.com-gif-maker.gif

Here is the full video:

 

https://www.youtube.com/watch?v=Z8LCg4bw1DY

Any help would be greatly appreciated.

1 ACCEPTED SOLUTION

Hi @HamidBee 

I may be over-simplifying this, but I'd have a measure like...

colour = IF(["your measure"] > 0, "P", "N")

 That'll create a measure that's based on "your measure" which will be "P" of your measure is positive, or "N" if negative. Use that exactly like Ruth did in her video and you should be good.

Stuart

View solution in original post

10 REPLIES 10
HamidBee
Impactful Individual
Impactful Individual

I managed to find the file that the author of the video used. She created a new calculated column to say if the value is greater than 0 then "p" if it's less than 0 then "n". Is there a way that you know of doing this by creating a measure? The author of the video told me there isn't but I'm mindful of the fact that new features are always being put in.

Hi @HamidBee 

No, Ruth's right, in this case because she's graphing a column "Population change" you need a calculated column for positive or negative, so the column has one entry for each record.

If you're graphing a measure, then you can have a measure as the colour attribute, provided there is one colour attribute for each measure value.

You can use either columns or measures here, but you should be consistent, not mix columns and measures here.

Hope this helps

Stuart

Okay, in my case. I am mapping dates from a calendar table onto one axis and a measure on the other axis.The measure has values that are greater than zero for some months and less than zero for other months. How would you set one colour scheme for values greater than zero and another for values less than zero? can I do this using a measure?

Hi @HamidBee 

I may be over-simplifying this, but I'd have a measure like...

colour = IF(["your measure"] > 0, "P", "N")

 That'll create a measure that's based on "your measure" which will be "P" of your measure is positive, or "N" if negative. Use that exactly like Ruth did in her video and you should be good.

Stuart

Stuart! It worked like a charm, thanks alot. I created a measure using the IF statement you provided. I then dragged the measure into the line glyph's colour. Green for P and Red for N.

Lollipop.png



Hi @HamidBee 

Great! glad I could help.

You may be interested in our blog, which has lots of charticulator information...

Charticulator - Burningsuit

and look out for our book on Charticulator, due to be published soon, which is a full reference to this brilliant tool.

Stuart

Yes I'll definitely take a look. Thanks. Out of curiosity are you a Microsoft or Charticulator stakeholder/employee?. 

No, I run a Training company that specialises in Training on Power BI and associated topics like Charticulator. Other than being a user of their products I have no other link to Microsoft/Charticulator.

Stuart

Sounds cool either way. I'll be sure to note down this information. I posted another question online regarding Charticulator. Perhaps you may know the solution to this also. Please see below:

https://community.powerbi.com/t5/Service/Percentages-not-plotting-properly-on-Charticulator/m-p/2307...


Burningsuit
Resident Rockstar
Resident Rockstar

Hi @HamidBee 

Yes, as you worked out, you need a measure to drive the colour difference. In this example "value type" is a measure (P for positive N for negative) which goes into the "Fill" attribute to drive the different colours.

Hope this helps

Stuart

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.

Top Solution Authors
Top Kudoed Authors