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

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.