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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
unclejemima
Post Patron
Post Patron

Multiple IF values

I've got a table called trandata, and a column called Send.  So Trandata[Send]

 

In Trandata[Send] can be either a 1, 2, 3, 4 or a 5.

 

Send = 1 = Journal
Send =2 = Bill
Send =3 = Invoice
Send =4 = A/R payment
Send =5 = A/P payment
 
With that, I was trying to make a or(if) statement...but I can only do 2 expressions. 

I want to make a calc column that if Trandata[Send] = 1, "Journal", if Trandata[Send]=2, "Bill", and so on.
 
Can someone tell me how I would do this?
 
 
1 ACCEPTED SOLUTION
RMDNA
Solution Sage
Solution Sage

@unclejemima,

 

When thinking about using multiple IF( ) statements, it's usually easier to use SWITCH( ).

 

In your case, you'd use:

Category = SWITCH(Trandata[Send], 1,"Journal",2,"Bill",3,"Invoice",4,"A/R payment",5,"A/P payment")

 

which will give you:

 

2.PNG

View solution in original post

2 REPLIES 2
unclejemima
Post Patron
Post Patron

Perfect thank you!

RMDNA
Solution Sage
Solution Sage

@unclejemima,

 

When thinking about using multiple IF( ) statements, it's usually easier to use SWITCH( ).

 

In your case, you'd use:

Category = SWITCH(Trandata[Send], 1,"Journal",2,"Bill",3,"Invoice",4,"A/R payment",5,"A/P payment")

 

which will give you:

 

2.PNG

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.