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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
gaby58
Frequent Visitor

Multiple If with Multiple Conditions

Hi All,

 

  Need help in creating a Custom Column. I have 2 columns and need to check values in first column, based on that I need to check values in another column, this one has multiple values, depending on each value Need to add a new value, could you please help?

 

IF([Section Stage]="Complete"or [Section Stage]="In Progress" and [DateLeft_Adjusted]="12/20/2024" or [DateLeft_Adjusted]= "10/11/2024") Then "01/07/2025") or [DateLeft_Adjusted] = "3/7/2025" or {DateLeft_Adjusted] = "5/22/2025" Then "6/5/2025"

Else

[DateLeft_Adjusted]+1

 

Thank you so much

12 REPLIES 12
gaby58
Frequent Visitor

Finally I got it to work

 

if
([Section Stage]="Complete" or [Section Stage]="In Progress") and ([DateLeft_Adjusted] = Date.From(#date(2024,12,20)) or [DateLeft_Adjusted] = Date.From(#date(2024,10,11))) then #date(2025,1,7) else if ([DateLeft_Adjusted] = Date.From(#date(2025,3,7)) or [DateLeft_Adjusted] = Date.From(#date(2025,5,22))) then Date.From(#date(2025,6,5))
else
Date.AddDays([DateLeft_Adjusted], 1)

 

Thank you all for the tips, appreciate it

Omid_Motamedise
Super User
Super User

Use this one:

IF (

([Section Stage]="Complete" or [Section Stage]="In Progress") and ([DateLeft_Adjusted]="12/20/2024" or [DateLeft_Adjusted]= "10/11/2024")) Then "01/07/2025" else if ([DateLeft_Adjusted] = "3/7/2025" or {DateLeft_Adjusted] = "5/22/2025") Then "6/5/2025"

Else

[DateLeft_Adjusted]+1

If my answer helped solve your issue, please consider marking it as the accepted solution. It helps others in the community find answers faster—and keeps the community growing stronger!
You can also check out my YouTube channel for tutorials, tips, and real-world solutions in Power Query with the following link
https://youtube.com/@omidbi?si=96Bo-ZsSwOx0Z36h

Thank you this, it says Token Eof expected at first Then

Thank you, this also gives syntax error

Anonymous
Not applicable

Write it like

 

if ([Section Stage]="Complete"or [Section Stage]="In Progress") and ([DateLeft_Adjusted]="12/20/2024" or [DateLeft_Adjusted]= "10/11/2024") then "01/07/2025" else if ([DateLeft_Adjusted] = "3/7/2025" or [DateLeft_Adjusted] = "5/22/2025") then "6/5/2025"

else

Text.From([DateLeft_Adjusted]+1)

Thank you, this kind of works, then in the column it throws an error

Expression.Error: We cannot apply operator + to types Date and Number.
Details:
Operator=+
Left=12/20/2024
Right=1

 

Use #duration(1,0,0,0)

Thank you, could you please let me know how to use this

gaby58
Frequent Visitor

Thank you, Actually I used the name as Date Left not as Column and now I am seeing the Token expected error at IN near Section Stage

lbendlin
Super User
Super User

Column = IF([Section Stage] IN {"Complete","In Progress"},
    SWITCH(TRUE(),
    [DateLeft_Adjusted] IN {"12/20/2024","10/11/2024"},"01/07/2025",
    [DateLeft_Adjusted] IN {"3/7/2025","5/22/2025"},"6/5/2025",
    [DateLeft_Adjusted]+1),
[DateLeft_Adjusted]+1)

Thank you , but it is throwing an error at Complete saying Token ',' expected

"Column" is a reserved word.  Try

 

Column1 =
IF (
    [Section Stage] IN { "Complete", "In Progress" },
    SWITCH (
        TRUE (),
        [DateLeft_Adjusted] IN { "12/20/2024", "10/11/2024" }, "01/07/2025",
        [DateLeft_Adjusted] IN { "3/7/2025", "5/22/2025" }, "6/5/2025",
        [DateLeft_Adjusted] + 1
    ),
    [DateLeft_Adjusted] + 1
)

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.

Top Kudoed Authors