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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Sean-OReilly
Helper IV
Helper IV

Need a Dax Measure Formula for If Statement

Hi 

I need a measure formula for - if vendor rating = 1, then "sub with insurance", if vendor rating = 3, then "sub no insurance", if not 1 or 3 then "Review and fix"

 

Sean-OReilly_0-1599643502857.png

 

3 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Sean-OReilly ,

as measure

Switch( True(),
max([vendor rating]) = 1 , "sub with insurance",
max([vendor rating]) = 3, "sub no insurance",
"Review and fix"
)

 

as column

Switch( True(),
[vendor rating] = 1 , "sub with insurance",
[vendor rating] = 3, "sub no insurance",
"Review and fix"
)


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

View solution in original post

Sean-OReilly
Helper IV
Helper IV

Thanks for coming back to me Amitchandak

Unfortunately the measure did not work for me.

Did i type it correctly?

 

Vendor Rate Description = switch(true(),max(PURCHASE_ACCOUNTS[VENDOR_RATING])=1, "Subbie with Insurance",max(PURCHASE_ACCOUNTS[VENDOR_RATING])=3, "Labour Only with Insurance",max(PURCHASE_ACCOUNTS[VENDOR_RATING])=2,"Subbie No Insurance",max(PURCHASE_ACCOUNTS[VENDOR_RATING])=4, "Labour Only No Insurance","Review & Fix")
 
Capture.PNG

View solution in original post

@Sean-OReilly , is vendor rating a text column, if yes then try

 

Vendor Rate Description = switch(true(),max(PURCHASE_ACCOUNTS[VENDOR_RATING])="1", "Subbie with Insurance",max(PURCHASE_ACCOUNTS[VENDOR_RATING])="3", "Labour Only with Insurance",max(PURCHASE_ACCOUNTS[VENDOR_RATING])="2","Subbie No Insurance",max(PURCHASE_ACCOUNTS[VENDOR_RATING])="4", "Labour Only No Insurance","Review & Fix")

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

View solution in original post

5 REPLIES 5
Sean-OReilly
Helper IV
Helper IV

Thanks for coming back to me Amitchandak

Unfortunately the measure did not work for me.

Did i type it correctly?

 

Vendor Rate Description = switch(true(),max(PURCHASE_ACCOUNTS[VENDOR_RATING])=1, "Subbie with Insurance",max(PURCHASE_ACCOUNTS[VENDOR_RATING])=3, "Labour Only with Insurance",max(PURCHASE_ACCOUNTS[VENDOR_RATING])=2,"Subbie No Insurance",max(PURCHASE_ACCOUNTS[VENDOR_RATING])=4, "Labour Only No Insurance","Review & Fix")
 
Capture.PNG

@Sean-OReilly , is vendor rating a text column, if yes then try

 

Vendor Rate Description = switch(true(),max(PURCHASE_ACCOUNTS[VENDOR_RATING])="1", "Subbie with Insurance",max(PURCHASE_ACCOUNTS[VENDOR_RATING])="3", "Labour Only with Insurance",max(PURCHASE_ACCOUNTS[VENDOR_RATING])="2","Subbie No Insurance",max(PURCHASE_ACCOUNTS[VENDOR_RATING])="4", "Labour Only No Insurance","Review & Fix")

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

Sorry - 1 last question on this.

Is there a way to remove "Review & Fix" from the Total Row in the Table Visual?

 

Sean-OReilly_0-1599648645688.png

 

You are a Legend - thanks a million man

 

 

amitchandak
Super User
Super User

@Sean-OReilly ,

as measure

Switch( True(),
max([vendor rating]) = 1 , "sub with insurance",
max([vendor rating]) = 3, "sub no insurance",
"Review and fix"
)

 

as column

Switch( True(),
[vendor rating] = 1 , "sub with insurance",
[vendor rating] = 3, "sub no insurance",
"Review and fix"
)


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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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