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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

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
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.