cancel
Showing results for 
Search instead for 
Did you mean: 
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
Super User
Super User

@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
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

BizApps LATAM 2023

Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

Power Platform Bootcamp

Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.