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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.