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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Louis66
Resolver I
Resolver I

Problem with SWITCH to change colors

Hello,

 

I try to change the color using a measure, but without much success. Basically, my condition does not work :

 

Louis66_1-1666220457148.png

 

Normally, the "Sugar" should show in Red... but everything shows in Orange.

 

Can someone help me ?

 

Regards,

 

Louis

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

Hi @Louis66 ,

 

This issue has been submitted internally.

Internal ICM ID: 343098936 

Please be patient to wait for fixing. If there is any news, I will update it here.

 

Best Regards,

Jianbo Li

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

6 REPLIES 6
v-jianboli-msft
Community Support
Community Support

Hi @Louis66 ,

 

This issue has been submitted internally.

Internal ICM ID: 343098936 

Please be patient to wait for fixing. If there is any news, I will update it here.

 

Best Regards,

Jianbo Li

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

Jayee
Responsive Resident
Responsive Resident

Hi @Louis66 ,

 

try below DAX Measure

colour =
SWITCH (
SELECTEDVALUE ( 'Cookie Types'[Cookie Type] ),
"Sugar", "Red",
"Orange"
)

Hello,

 

Unfortunately this DAX Measure does not work either - please see this screenshot :

Louis66_0-1666260287305.png

 

Louis

lukiz84
Memorable Member
Memorable Member

?! that's the same as the IF statement.

lukiz84
Memorable Member
Memorable Member

Just for testing purposes, can you add your Colour measure to the matrix next to Cookie Type and see if it returns Red/Orange?

I tried it, but no success either

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

May 2025 Monthly Update

Fabric Community Update - May 2025

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