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

Preparing for a certification exam? Ask exam experts all your questions on May 15th. 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
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Kudoed Authors