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
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
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.