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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Zachblaster
New Member

How to highlight in colours which numbers do not belong in a specified range

Hi everyone, hope you are all having a great day.

 

I am creating my first proper PowerBI report, and I am tasked with highlighting all the numbers in red that don't go into a specified range of numbers. To be more precise:

In the far left column are the various products we sell. In the column that is encircled I have the current discounts. In the 3 columns on the right is the range I would like the current discount to be within. 

I would like the rows to be highlighted where the "W.Disc." number is not within the range from the "StretchedPrice(Disc-%)" and "FloorPrice(Disc-%)". 

 

PowerBI Question.png

 

If you have any idea as to which measures can be utilized for this purporse or any if you know any other methods, it would be graetly appreciated! Thank you. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Zachblaster ,

Please create a measure with below dax formula, and set the conditional format background color for visual:

Measure =
VAR _a =
    SELECTEDVALUE ( 'Table'[W.Disc] )
VAR _b =
    SELECTEDVALUE ( 'Table'[StretchedPrice] )
VAR _c =
    SELECTEDVALUE ( 'Table'[FloorPrice] )
VAR _result =
    IF ( _a >= _b && _a <= _c, "Green", "Red" )
RETURN
    _result

vbinbinyumsft_0-1699508770460.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
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

6 REPLIES 6
Anonymous
Not applicable

Hi @Zachblaster ,

Please create a measure with below dax formula, and set the conditional format background color for visual:

Measure =
VAR _a =
    SELECTEDVALUE ( 'Table'[W.Disc] )
VAR _b =
    SELECTEDVALUE ( 'Table'[StretchedPrice] )
VAR _c =
    SELECTEDVALUE ( 'Table'[FloorPrice] )
VAR _result =
    IF ( _a >= _b && _a <= _c, "Green", "Red" )
RETURN
    _result

vbinbinyumsft_0-1699508770460.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you so much! 
Another questions while I am at it. 

I have been asked to create another column that displays how far the W.Disc% value is from the upper or lower limit (outside the StretchedPrice and FloorPrice). So for example, if the W.Disc% is 56% and the lower limit is 60%, then I would like it to display the value 4%. (or -4%) Once again, you are a huge life savour. Can't express my thanks enough.

 

Best regards,

Zach

Zachblaster
New Member

Thank you once again i found the conditional formatting button. 

 

Unfortunately in conditional formatting you are only able to base the rule on 1 column. I need for the condition to be based on 2 rules ( of: IF below the floor target & above the target = red colour). Is there any measure you could perhaps think of that you allow me to get this information? Thank you

Zachblaster
New Member

Thank you for your input.

I unfortunately am unable to find the specific field you're pointing to in your screenshot. 

Where on the below screenshot could i find conditional formatting? 

 

Zachblaster_0-1699354423418.png

 

 

 

Here must be the name of the columns "W.Disc." etc. Open this. There where you can see the colums which you inserted in you Widget

Bild 1.png

yakamoz007
Helper I
Helper I

Hi you can use the conditional formatting.2023-11-07 11_41_58-PreZero KER Cockpit - Power BI Desktop.png

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors