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
Anonymous
Not applicable

can we change bar colour based on selected values for measures

bar.PNG

 

is there any way to implements visual like this?

if year is 2015 then blue

if year is 2016 then orange so on....

and i want to display measure values using bars.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

We can use sparked bar instead of bar and achieve above result. USE below measure:

bar=if(hasonevalue(dim[column1].year),rept('|',count_id),blank())

 

count_id=count(fact[fact_id])

 

 

BAR.PNG

View solution in original post

8 REPLIES 8
PaulDBrown
Community Champion
Community Champion

@Anonymous 

 

This is the closest I've achieved:

 

 

Colour years.JPG

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Anonymous
Not applicable

this will work for single measure only.

If you have to add more than 2 3 measures you have to add it into tooltips and to see the measure values you need to hover over bars.

But, our client don't want this type user interface. they are expecting to have bars in matrix/table or any other visual where visualization for all values(measures) should be clear.


@PaulDBrown wrote:

@Anonymous 

 

This is the closest I've achieved:

 

 

Colour years.JPG

 


 

Anonymous
Not applicable

We can use sparked bar instead of bar and achieve above result. USE below measure:

bar=if(hasonevalue(dim[column1].year),rept('|',count_id),blank())

 

count_id=count(fact[fact_id])

 

 

BAR.PNG

saraMissBI
Resolver I
Resolver I

Hi,

You can format the colors of the bars by years through conditional formatting in the format of your bar chart under "Data Colors". As for the numbers, make sure you have Data Labels set to ON to display numbers for each bar.

 

If you have any other questions, I would be glad to help!

Thank you

Anonymous
Not applicable

I have 8 to 9 measures in my report. i want same colour for all measures for particular year.

e.g for 2017 year measure1, measure2....so on will be blue

for 2018 year measure1, measure2....so on will be orange.

 

can we add multiple measure in bar chart? i don't think so we can add. bar chart is not correct visual for above scenario.

if you are trying to do it in a pivot o matrix table, I don't know how to do it, I've tried it but I can't find the option, the only thing close to what you want, is to change the color background without distinguishing which number is greater than another.

santiagomur
Resolver II
Resolver II

create a calculate column with the colors you want, something like this.

 

color bar = IF(YEAR('Table'[date])=2019;"#c21b17";IF(YEAR('Table'[date])=2018;"#b0b2b3";"white"))
 
the crate the bar char 
then in data colors default color click on the ... conditional formatting choose field value and the column you creat befor "color bar". 
YJ
Resolver II
Resolver II

I would be interested to know too, 

regards

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.