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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

SQL to DAX

Hi

 

Could someone please help me to convert this in to DAX.

 

IIF(stop_action_description = 'Pick Up', (
   IIF((
     NOT ISNULL(aa_event_date_et)
     AND TO_CHAR(aa_event_date_et, 'YYYY-MM-DD') <> '1900-01-01'
     AND TO_CHAR(aa_event_date_et, 'YYYY-MM-DD') <> '2000-01-01'
     ), aa_event_date_et, IIF(TO_CHAR(schdarrivetodt_et, 'YYYY-MM-DD') <> '2000-01-01' AND NOT ISNULL(schdarrivetodt_et)
     , schdarrivetodt_et, TO_DATE('1900-01-01 00:00:00', 'YYYY-MM-DD HH24:MI: SS')))
   ), IIF((
    stop_action_description = 'Delivery'
    OR stop_action_description = 'Pick Up - Delivery'
    ), IIF((
     NOT ISNULL(last_agreed_dt_et)
     AND TO_CHAR(last_agreed_dt_et, 'YYYY-MM-DD') <> '1900-01-01'
     ), last_agreed_dt_et, IIF((
      NOT ISNULL(ab_event_date_et)
      AND TO_CHAR(ab_event_date_et, 'YYYY-MM-DD') <> '2000-01-01'
      ), ab_event_date_et, IIF((TO_CHAR(schddeparttodt_et, 'YYYY-MM-DD') <> '2000-01-01')
      AND NOT ISNULL(schddeparttodt_et)
      , schddeparttodt_et, TO_DATE('1900-01-01 00:00:00', 'YYYY-MM-DD HH24:MI: SS'))))))

 

Thanks in advance

1 REPLY 1
v-danhe-msft
Employee
Employee

Hi @Anonymous ,

Sorry, I am not farmiliar with Sql statements, could you please just post your sample data and explain your logic of your data and post your desired result if possible?


Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.