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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Power Query If condition

Hello Power Users,

I'm trying to write some multiple if statements in Query editor(Power query) but i'm not able to get the correct answer.  I have written below syntax but i'm missing something.  else if then else if line is not working properly.

Syntax:
if [Column A] = "ABCD" then [Start Date]
        else if [Column A] = "BCFD" then [Start Date]
  else if [Column A] = "QWER" then [Submission Date]
  else if [Column A] = "IUYT" then
                                            each if [Column B] = "lkjh" then [Submission Date]
                                            else if [Column B] = "hygt" then [End Date]
                                            else if [Column B] = "bgfd" then [End Date"]
                                            else null           
  else [#End Date"]

 

Please help me.

 

Thanks,

1 ACCEPTED SOLUTION
Mikelytics
Resident Rockstar
Resident Rockstar

Hi @Anonymous ,

 

Can you try thw folloing please?

 

if [Column A] = "ABCD" then [Start Date]
        else if [Column A] = "BCFD" then [Start Date]
  else if [Column A] = "QWER" then [Submission Date]
  else if [Column A] = "IUYT" then
                                            (if [Column B] = "lkjh" then [Submission Date]
                                            else if [Column B] = "hygt" then [End Date]
                                            else if [Column B] = "bgfd" then [End Date"]
                                            else null)           
  else [#End Date"]

 

 Best regards

Mikelytics

 

Did I solve your request? Please mark my post as solution.

 

Appreciate your Kudos.

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!

View solution in original post

3 REPLIES 3
v-jingzhang
Community Support
Community Support

Hi @Anonymous 

Have you tried solutions in above replies? If you have solved it, kindly accept the appropriate reply as the solution or post your own solution. If not, can you share more info about how it is going now so that we can help further. Thanks.

Mikelytics
Resident Rockstar
Resident Rockstar

Hi @Anonymous ,

 

Can you try thw folloing please?

 

if [Column A] = "ABCD" then [Start Date]
        else if [Column A] = "BCFD" then [Start Date]
  else if [Column A] = "QWER" then [Submission Date]
  else if [Column A] = "IUYT" then
                                            (if [Column B] = "lkjh" then [Submission Date]
                                            else if [Column B] = "hygt" then [End Date]
                                            else if [Column B] = "bgfd" then [End Date"]
                                            else null)           
  else [#End Date"]

 

 Best regards

Mikelytics

 

Did I solve your request? Please mark my post as solution.

 

Appreciate your Kudos.

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!
darentengmfs
Post Prodigy
Post Prodigy

@Anonymous 

 

Hi, do you have a typo in your syntax? Please take a look at what you posted.

darentengmfs_0-1611177854893.png

Also, I think you have an extra "else statement" at the end. 

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.

Top Solution Authors