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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
JK14
New Member

DAX Highlight Range Selection

Hi All

I would love to have some helping hands with a PowerBI DAX formula to multi-select highlight range results from filter. At current I can get DAX to highlight 1 set of selection from filter, however if I select more than 1 it will highlight all values between Max and Min and not as ones specifically selected.
For example, if selection range was both 0-49 and 150-199 at the moment report will highlight all results from 0-199.


I have a table with range

 
OrderMinValueMaxValueRange
10490-49
2509950-99
3100149100-149
4150199150-199
5200249200-249
6250299250-299

 

Background colour condition based off below condition being 1:

 

Result =
VAR ComMin = [CommittedMin]
VAR ComMax = [CommittedMax]
VAR ComValue = [Committed]
RETURN
IF(ISFILTERED('Table'[Range]), IF(NOT(ISBLANK(ComValue))&&ComValue >= ComMin && ComValue <= ComMax, 1, 0), 0)

 

And a few more measures:

 

CommittedMin = DIVIDE(MINX(VALUES(' Difference'[MinValue]), [MinValue]), 100)
CommittedMax = DIVIDE(MAXX(VALUES(Difference'[MaxValue]), [MaxValue]), 100)
Committed = IF([Check] <> 0, BLANK(), DIVIDE([Billed], [Planned], 0))

 

 JK14_0-1710841373764.png

Anyone who can shed some light will be greatly appreciated, thank you.

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi, 
Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1710865411367.png

 

background color condition: =
VAR _t =
    FILTER (
        ADDCOLUMNS (
            'Range',
            "@condition",
                IF (
                    [Percentage:] >= 'Range'[MinValue]
                        && [Percentage:] <= 'Range'[MaxValue],
                    1
                )
        ),
        [@condition] = 1
    )
RETURN
    IF ( ISFILTERED ( 'Range'[Range] ), IF ( COUNTROWS ( _t ) > 0, 1, 0 ) )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

2 REPLIES 2
JK14
New Member

Thanks you very much @Jihwan_Kim!   This works perfectly and I never would have thought of ADDCOLUMNS()!

Much appreciated your help 😀

Jihwan_Kim
Super User
Super User

Hi, 
Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1710865411367.png

 

background color condition: =
VAR _t =
    FILTER (
        ADDCOLUMNS (
            'Range',
            "@condition",
                IF (
                    [Percentage:] >= 'Range'[MinValue]
                        && [Percentage:] <= 'Range'[MaxValue],
                    1
                )
        ),
        [@condition] = 1
    )
RETURN
    IF ( ISFILTERED ( 'Range'[Range] ), IF ( COUNTROWS ( _t ) > 0, 1, 0 ) )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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