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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Anonymous
Not applicable

Conditional Format except slicer particular region

Hi Team,

 

I have created conditional formatting for the below table but If the slicer -> Country ->All then conditional format should be removed.

 

Country - if select 'ALL' then won't be apply ,except all showing conditional format.

logo.JPG

 

Thanks,

K'udt

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

Hi @Anonymous ,

 

From what I understand, do you want the following effect?
If the slicer[country] is not selected, the visual has no conditional formatting changes. If the slicer selects a value, the conditional formatting in the visual changes.

 

If you do, please see my following solution.

1.Create a country table using dax.

Country = DISTINCT('Table'[Country])

vstephenmsft_0-1653986699257.png

The relationship:

vstephenmsft_1-1653986716028.png

 

2.Create a measure for conditional formatting. The ISFILTERED function is used to determine whether the slicer is selected.

Measure = IF(ISFILTERED('Country'[Country]),IF(SUM('Table'[Value])>3,"Yellow","Green"))

 

3.Then comes the most critical point. The slicer puts the country in the ISFILTERED function in the above measure, and the table puts the country field of the main table.

vstephenmsft_2-1653986899661.png

vstephenmsft_3-1653986916269.png

 

4.Set the color under conditional formatting.

vstephenmsft_4-1653987055979.png

 

Now, if the slicer is no selected. No color changes.

vstephenmsft_5-1653987103633.png

If the slicer is selected, color changes.

vstephenmsft_6-1653987137093.png

 

Best Regards,

Stephen Tao

 

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

4 REPLIES 4
v-stephen-msft
Community Support
Community Support

Hi @Anonymous ,

 

From what I understand, do you want the following effect?
If the slicer[country] is not selected, the visual has no conditional formatting changes. If the slicer selects a value, the conditional formatting in the visual changes.

 

If you do, please see my following solution.

1.Create a country table using dax.

Country = DISTINCT('Table'[Country])

vstephenmsft_0-1653986699257.png

The relationship:

vstephenmsft_1-1653986716028.png

 

2.Create a measure for conditional formatting. The ISFILTERED function is used to determine whether the slicer is selected.

Measure = IF(ISFILTERED('Country'[Country]),IF(SUM('Table'[Value])>3,"Yellow","Green"))

 

3.Then comes the most critical point. The slicer puts the country in the ISFILTERED function in the above measure, and the table puts the country field of the main table.

vstephenmsft_2-1653986899661.png

vstephenmsft_3-1653986916269.png

 

4.Set the color under conditional formatting.

vstephenmsft_4-1653987055979.png

 

Now, if the slicer is no selected. No color changes.

vstephenmsft_5-1653987103633.png

If the slicer is selected, color changes.

vstephenmsft_6-1653987137093.png

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

dhruvinushah
Responsive Resident
Responsive Resident

Hi @Anonymous , K'udt, 
Can you please rephrase your question and include some context to make it easier to understand what conditional formatting logic you have applied and what's not working?









Anonymous
Not applicable

Hi,

Thanks for your reply,

 

Conditional formatting applied below table , in that Slicer -> Country (selected all) -> then conditional format should not apply, if I select Country -> except 'All" then applicale the conditioanl format.

 

Thanks,

K'udt

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.