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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Pranvanand
Regular Visitor

Conditional Formatting Power BI

Hello Peers @rajendraongole1 @lbendlin @Poojara_D12 , 

 

I tried all the standard conditional formatting for the following table for the cloloumn quanity but couldn't rech to a solution. Can anybody help me in the following scenario? I am not good at DAX.

 

The conditional formatting in coloumn Quantity is based on min and max whicht is different for the each department. I want following color coding. For each depatment, if the quantity is smaller than min then "Red" or greater than max then "Red" & if the quanity falls between or equal to min and max  then "Green".

 

Pranvanand_0-1736342551446.png

 

Quantity value  smaller than min or greater than max
Quantity Value in between or equal to min and max
     
     
Dapertment number Quantity Number of OrdersMin Max
11A3021050
12B8035070
13C110480150
14D1053050
1 ACCEPTED SOLUTION

Same approach. Note I corrected the typo.

 

lbendlin_0-1736520955839.png

 

View solution in original post

7 REPLIES 7
v-yohua-msft
Community Support
Community Support

Hi, @Pranvanand 

Have you solved your problem? If so, can you share your solution here and mark the correct answer as a standard answer to help other members find it faster? Thank you very much for your kind cooperation!

 

Best Regards

Yongkang Hua

Pranvanand
Regular Visitor

Hi @lbendlin ,

Thank you very much for your help.

 

For some of the feilds its not working. Have I done somwthing wrong here?

I creadted a measure and under conditional formating, I can not select the Color gradient so I chose Field value and the measure color.

 

Pranvanand_0-1736437389964.png

Pranvanand_1-1736437517975.png

 

Please provide sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.

Hi @lbendlin

As following is my data

 

As per attached image I want conditions color coding for this. 

Pranvanand_0-1736498202379.png

 

DepartmentQuntityOrdersMin Max
911950118001000
911936315400
912290518001000
91122K825400
91132N818001000
91263E828001000
91222H1015400
9122901015400
91134C1828001000
9115001818001000
91132F2011030
91363B2015400
9123903028001000
9123003118001000
91132K3248001000
91134C3345400
9136203428001000
91363C3428001000
91170B3528001000
91222H3538001000
91281B4018001000
91132H41325100
91226B4438001000
91281B4435400
91132I47515150
91914252238001000
9136206015400
91190A71158001000
91132I79615100
91363C7925400
91134D8028001000
9191108298001000
91D1058918001000
91268B9065400
91130096338001000
91222G10015400
91132M144125400
91192I14565400
91226B146105400
91381015035400
91240015635400
91268A16511510
91222C176138001000
91365018058001000
912390186135400
91222J18978001000
911500192135400
91914222355400
91122G223128001000
911200232558001000
91168C238225400
91182724075400
91263C240165400
91268C255175400
91130025685400
91122I260128001000
91168C27098001000
91132N285205400
91122L288125400
91122J289168001000
91220731098001000
91192I33178001000
91190B34975400
91363A35595400
91225036368001000
91222B40025400
91263D41088001000
91222G41888001000
91232L42845400
919101440258001000
913690453305400
91260046785400
911936490218001000
911921521125400
91222A53085400
913660548175400
91222C552185400
91132K555685400
91232N558135400
91122K561288001000
91190B565508001000
91222K574118001000
91910161995400
91222D68455400
91122G701305400
913690742278001000
9136008382698001000
91224086385400
91363A888358001000
912520903155400
912920918278001000
919185933158001000
912610937155400
919110979955400
91170B1135295400
9126001138308001000
91122I1166975400
9119211186868001000
9121001344628001000
9121901357398001000
9119151374978001000
9129201943725400
91D10520281035400
9112002199705400
91193023441308001000
91910023612768001000
91D10024251215400
91222K2844385400
9129452888165400
91182531321078001000
91170C34771628001000
91122J3543705400
91170C43171705400
9122504476325400
91194547651188001000
91191050042248001000
91192050911465400
9119105410685400
9119305476645400
91D10060042168001000
91191574671575400
91360076314375400
91192085151708001000
91210092501185400
91910010577615400
911825118181325400
9136401236055400
911945578955375400

Same approach. Note I corrected the typo.

 

lbendlin_0-1736520955839.png

 

Thank you very much for your help and I accept this as a solution.

lbendlin
Super User
Super User

Color = if(sum('Table'[Quantity ])<sum('Table'[Min ]) || sum('Table'[Quantity ])>sum('Table'[Max]),"red","lightgreen")

 

Use the Color measure value for the background color.

 

lbendlin_0-1736360967689.png

 

 

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! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.