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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Result of SWITCH being an IF function not working in conditional formatting of Table Visual

Hello,

 

I have a measure which shades cells in a table visual based on the month, and the ranking of those months to show a subscription length.

Screenshot 2022-10-19 122352.png

 

For this particular instance, I want to shade one of the rows differently because it has a different subscription rollover month.

I have tried to select this particular customer by a number of fields but none seem to return the expected result, just the result of the condtion not being met.

Screenshot 2022-10-18 135545.png

 I would like the second row to be only shaded to september. But it never is able to pick up the first condition. 

The measure returns the shading colour and is applied via field value in conditional formatting.

 

Any help with this is greatly appreciated.

 

Thanks.

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , True Switch True

 

Switch(True(),

Selectedvalue(Agent[Agent id]) = 122 && [Product Rank] <=2, "Light Blue",

Selectedvalue(Agent[Agent id]) = 122 && [Product Rank] <=4, "Drak Blue",

"White"

)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi @amitchandak

 

The conditional statements are deciding how many cells to shade, not necesarily what colour. Product rank ranks the months decending so "if(productrank <= 2)" will shade the last two months (Oct, Sep). 

 

I am trying to nest the IF function inside the Switch function so that the RESULT and the ELSE result are IF functions.

 

Is this possible to do inside condtional formating? I am assuming it would require for the conditional formatting to be evaluated for every line.

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.