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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
AMBP1973
Helper II
Helper II

Conditional Formatting

Hello,

 

I am developing a report on a SWOT analysis. I have a slicer at the top of each page with Horizontal Selections. I would like to sort them in the order of 'SWOT', and colour each button accordingly. Could someone please assist on how this could be acheived.

 

AMBP1973_0-1711512634961.png

 

I also have a table that has the SWOT results, I would like to also have each cell coloured according to the SWOT. I would really appreciate assistance on this also.

AMBP1973_1-1711512783523.png

Thanks in advance 🙂

2 ACCEPTED SOLUTIONS
Uzi2019
Super User
Super User

Hi @AMBP1973 

You have to create seperate calculated column. please followthe steps:
Step1: create calculted column

Sort =
SWITCH(TRUE(),
S[SWOT]="Strength","1.Strength",
S[SWOT]="Weakness", "2.Weakness",
S[SWOT]="Opportunity", "3.Opportunity",
S[SWOT]="Threat", "4.Threat"
)
 
Step2: take you sort column in your table 
Uzi2019_0-1711516112568.png



Step3: for color each cell of a swot , you have to write measure for that.
create measure as below

Color = IF(MIN(S[SWOT])="Strength","Red",IF(MIN(S[SWOT])="Weakness","Green",IF(MIN(S[SWOT])="Opportunity","Yellow","Blue")))
 
Step4: you can take your own color / hex code . apply the condition formatting on background of a swot column.
Uzi2019_1-1711516301843.png

 
Then select field value and measure

Uzi2019_2-1711516355105.png

 

Step5: final result 

Uzi2019_3-1711516394014.png

 

 

I hope I answered your question!

 

 




Don't forget to give thumbs up and accept this as a solution if it helped you!!!

View solution in original post

Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.

 

Jihwan_Kim_0-1711517355139.png

 

 

color condition measure: = 
SWITCH ( TRUE(),
    SELECTEDVALUE('SWOT Dimension'[SWOT Type] ) ="Strength", "Green",
    SELECTEDVALUE('SWOT Dimension'[SWOT Type] ) ="Weakness", "Orange",
    SELECTEDVALUE('SWOT Dimension'[SWOT Type] ) ="Opportunity", "Light Blue",
    SELECTEDVALUE('SWOT Dimension'[SWOT Type] ) ="Threat", "Red"
)

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @AMBP1973 ,

Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.

If these also don't help, please share more detailed information and description to help us clarify your scenario to test.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.

 

Jihwan_Kim_0-1711517355139.png

 

 

color condition measure: = 
SWITCH ( TRUE(),
    SELECTEDVALUE('SWOT Dimension'[SWOT Type] ) ="Strength", "Green",
    SELECTEDVALUE('SWOT Dimension'[SWOT Type] ) ="Weakness", "Orange",
    SELECTEDVALUE('SWOT Dimension'[SWOT Type] ) ="Opportunity", "Light Blue",
    SELECTEDVALUE('SWOT Dimension'[SWOT Type] ) ="Threat", "Red"
)

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Uzi2019
Super User
Super User

Hi @AMBP1973 

You have to create seperate calculated column. please followthe steps:
Step1: create calculted column

Sort =
SWITCH(TRUE(),
S[SWOT]="Strength","1.Strength",
S[SWOT]="Weakness", "2.Weakness",
S[SWOT]="Opportunity", "3.Opportunity",
S[SWOT]="Threat", "4.Threat"
)
 
Step2: take you sort column in your table 
Uzi2019_0-1711516112568.png



Step3: for color each cell of a swot , you have to write measure for that.
create measure as below

Color = IF(MIN(S[SWOT])="Strength","Red",IF(MIN(S[SWOT])="Weakness","Green",IF(MIN(S[SWOT])="Opportunity","Yellow","Blue")))
 
Step4: you can take your own color / hex code . apply the condition formatting on background of a swot column.
Uzi2019_1-1711516301843.png

 
Then select field value and measure

Uzi2019_2-1711516355105.png

 

Step5: final result 

Uzi2019_3-1711516394014.png

 

 

I hope I answered your question!

 

 




Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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