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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
refint650
Helper III
Helper III

Excel formula if else to power bi

Hello ALL

I'm decoding excel forumula IF Else Datelogic calculation couldnt figure how to re-write in Dax or Mquery Calculation need some help .
F = StartDate
G = RelesaseDate
H = PostedDate
I = AccountDate

ActualDate

IF( ActualDate>=StartDate && RelesaseDate>ActualDate) then "A1"
If( ActualDate>=ReleaseDate && Posteddate>ActualDate) then "A2"
If (ActualDate>=PostedDate && Accountdate>ActualDate) then "A2"
if (Startdate>ActualDate) then ""

 

Thanks

Vs

1 ACCEPTED SOLUTION
selimovd
Super User
Super User

Hey @refint650 ,

 

you can do something like this with the combination of SWITCH with TRUE().

Check the following article on how that works:

https://p3adaptive.com/2015/03/the-diabolical-genius-of-switch-true/

 

And here the example how it would look like:

ActualDate =
SWITCH (
    TRUE (),
    ActualDate >= StartDate && RelesaseDate > ActualDate, "A1",
    ActualDate >= ReleaseDate && Posteddate > ActualDate, "A2",
    ActualDate >= PostedDate && Accountdate > ActualDate, "A2",
    ""
)

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍

Best regards
Denis

Blog: WhatTheFact.bi
Follow me: twitter.com/DenSelimovic

View solution in original post

2 REPLIES 2
refint650
Helper III
Helper III

@selimovd 

 

Let me  rewrite as you said will let you know . Thank you 🙂

selimovd
Super User
Super User

Hey @refint650 ,

 

you can do something like this with the combination of SWITCH with TRUE().

Check the following article on how that works:

https://p3adaptive.com/2015/03/the-diabolical-genius-of-switch-true/

 

And here the example how it would look like:

ActualDate =
SWITCH (
    TRUE (),
    ActualDate >= StartDate && RelesaseDate > ActualDate, "A1",
    ActualDate >= ReleaseDate && Posteddate > ActualDate, "A2",
    ActualDate >= PostedDate && Accountdate > ActualDate, "A2",
    ""
)

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍

Best regards
Denis

Blog: WhatTheFact.bi
Follow me: twitter.com/DenSelimovic

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.