If/Or multiple statement

Apple08

Active Member
Joined
Nov 1, 2014
Messages
450
Hi All

I have a column with different text names and including the month names January to December. I would like them in order August as 1, September as 2 and so on. I have created a formula below however I would like to put those names which are not in months as "0". The formula below can't add in "0" to other. I am not sure how to do it in Power BI by using the similar function as If/Or in Excel. Please could anyone help? Many thanks.

Rich (BB code):
Deliv Order = if(summ_deliverable[deliv_name]="August","1",if(summ_deliverable[deliv_name]="September","2",if(summ_deliverable[deliv_name]="October","3",if(summ_deliverable[deliv_name]="November","4",if(summ_deliverable[deliv_name]="December","5",if(summ_deliverable[deliv_name]="January","6",if(summ_deliverable[deliv_name]="February","7",if(summ_deliverable[deliv_name]="March","8",if(summ_deliverable[deliv_name]="April","9",if(summ_deliverable[deliv_name]="May","10",if(summ_deliverable[deliv_name]="June","11",if(summ_deliverable[deliv_name]="July","12"))))))))))))
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Try this.
Code:
Deliv Order =
VAR MonthName = summ_deliverable[deliv_name]
VAR Result =
    SWITCH (
        TRUE (),
        MonthName = "January", 6,
        MonthName = "February", 7,
        MonthName = "March", 8,
        MonthName = "April", 9,
        MonthName = "May", 10,
        MonthName = "June", 11,
        MonthName = "July", 12,
        MonthName = "August", 1,
        MonthName = "September", 2,
        MonthName = "October", 3,
        MonthName = "November", 4,
        MonthName = "December", 5,
        0
    )
RETURN
    Result
 
Upvote 0

Forum statistics

Threads
1,215,391
Messages
6,124,673
Members
449,179
Latest member
fcarfagna

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top