cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Heidi Helper I
Helper I

Doing a conditional formatting with over 100 conditions

Hi Power BI experts! 

 

I need to do a conditional formatting of a column with over 100 conditions. Does anyone have experience on such tasks? What would be the fastest way of doing it? The task I have is re-categorizing over 100 topics into new categories. Like

 

Apple => vegetable

Orange => vegetable

Cucumber => vegetable

Potato => vegetable

Milk => dairy product

Yogurth => dairy product 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User IV
Super User IV

Re: Doing a conditional formatting with over 100 conditions

@Heidi you can either do it in power query using if condition or in DAX using switch. Switch would be more easy to read and easy to manage.

 

And other option could be to add another table with unique value of Fruit and Fruit type and do the lookup or related function. This is more cleaner way, and doesn't required and if/switch function.






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





View solution in original post

2 REPLIES 2
Super User IV
Super User IV

Re: Doing a conditional formatting with over 100 conditions

@Heidi you can either do it in power query using if condition or in DAX using switch. Switch would be more easy to read and easy to manage.

 

And other option could be to add another table with unique value of Fruit and Fruit type and do the lookup or related function. This is more cleaner way, and doesn't required and if/switch function.






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





View solution in original post

Heidi Helper I
Helper I

Re: Doing a conditional formatting with over 100 conditions

Hi parry2k, 

 

thank you for your thorough answer! Adding another table sounds like the best way to go and easiest to update incase we at some point decide to group potatoes into dairy products. I will look into that! 

 

With appreciating and kind regards, 

Heidi 

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors