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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
AjithReddy049
Frequent Visitor

TOP3 and Bottom 3

Hi Team,

 

I have some scenarios, Here I would like to highlight to where ever we have sales data more than 17% Green 
 less than 3% Red remaining Blue, case by using selected slicer values we would like to change color formatting.

AjithReddy049_0-1670933360698.png

 

 

thanks & regards,

Ajith Reddy

 

 

 

1 ACCEPTED SOLUTION

Hi @AjithReddy049 ,

 

You can create a measure as follows.

Measure = var _amount=SUM('Table'[Sales Amount])
var _all=CALCULATE(SUM('Table'[Sales Amount]),ALLSELECTED('Table'))
var _percent=DIVIDE(_amount,_all)
return SWITCH(TRUE(),_percent>0.17,"green",_percent<0.03,"red",_percent<=0.17&&_percent>=0.03,"blue")

Go to the following setting and click "fx".

vstephenmsft_1-1672041265796.png

Select "Field value" in Format Style and then choose the measure just created.

vstephenmsft_2-1672041381609.png

Click OK, the result is below.

vstephenmsft_3-1672041452372.png

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

4 REPLIES 4
TomMartens
Super User
Super User

Hey @AjithReddy049 ,

 

I'm wondering if you tried "Color by rules" as described in this article: https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-conditional-table-formatting?WT.mc...

 

Of course, instead of using the table formatting option, you start the conditional formatting here, because it's column chart:
image.png

Besides that, the article is also valid for column charts.

Hopefully, this gets you started, if not, please describe why "Color by rules" can not be applied to your problem.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

@TomMartens  in my case I would like to show variations in bar color if  > 80% Green, >60 to <30 Blue, and>30 Red like that, is there any possibility we can achieve this thing in bar chat?

 

thanks & Regards,

Ajith Reddy

Hi @AjithReddy049 ,

 

You can create a measure as follows.

Measure = var _amount=SUM('Table'[Sales Amount])
var _all=CALCULATE(SUM('Table'[Sales Amount]),ALLSELECTED('Table'))
var _percent=DIVIDE(_amount,_all)
return SWITCH(TRUE(),_percent>0.17,"green",_percent<0.03,"red",_percent<=0.17&&_percent>=0.03,"blue")

Go to the following setting and click "fx".

vstephenmsft_1-1672041265796.png

Select "Field value" in Format Style and then choose the measure just created.

vstephenmsft_2-1672041381609.png

Click OK, the result is below.

vstephenmsft_3-1672041452372.png

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Hey @AjithReddy049 ,

did you check the article?

If not, please describe why not and also provide sample data and explain the expected result based on the sample data you provide.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.