cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
HamidBee
Post Prodigy
Post Prodigy

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
Post Prodigy
Post Prodigy

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
Super User
Super User

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
Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Power BI Dev Camp Session 22 768x460.jpg

Check it out!

Mark your calendars and join us on Thursday, May 26 at 11a PDT for a great session with Ted Pattison!

Top Solution Authors
Top Kudoed Authors