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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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"
)


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")

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")

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"
)


Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors