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 August 31st. Request your voucher.

Reply
Anonymous
Not applicable

PowerBI Conditional Formatting Based on Slicer

Hello, 

 

I have a slicer which gives the option to choose between Japan, Korea or both. I also have a Target for each which changes for Japan, Korea or total - so what I mean is that if Japan is chosen my current value should be compared to a 15% and conditional formatted accordingly. If Korea is chose it should be compared to 16% and if both are chosen then it should be compared to 14.5%.  Kindly advise how I can conditional format according to the restriction above.

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

You could create a measure such as:

measure =
SWITCH (
    SELECTEDVALUE ( 'table'[country] ),
    "Japan", SUM ( [value] ) - 0.15,
    "Korea", SUM ( [value] ) - 0.16,
    IF (
        CALCULATE (
            DISTINCTCOUNT ( 'table'[country] ),
            FILTER ( ALLSELECTED ( 'table' ), [country] IN { "Korea", "Japan" } )
        ) = 2,
        SUM ( [value] ) - 0.145
    )
)


Best Regards,
Community Support Team _ Yalan Wu
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

1 REPLY 1
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

You could create a measure such as:

measure =
SWITCH (
    SELECTEDVALUE ( 'table'[country] ),
    "Japan", SUM ( [value] ) - 0.15,
    "Korea", SUM ( [value] ) - 0.16,
    IF (
        CALCULATE (
            DISTINCTCOUNT ( 'table'[country] ),
            FILTER ( ALLSELECTED ( 'table' ), [country] IN { "Korea", "Japan" } )
        ) = 2,
        SUM ( [value] ) - 0.145
    )
)


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Top Solution Authors