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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

How can i write this logic in DAX

i am trying to recreate this column using DAX based in this power query logic but cant find the right syntax. anyone with a good suggestion?

= Table.AddColumn(#"Filtered Rows", "RadioButton", each if((Date.From([START_DATE]) <>"" ) and (Date.From(END_DATE]) = "") or
(Date.From([START_DATE]) <= Date.AddDays(Date.From(DateTime.LocalNow()),3))) then "3 Forward" else if (Date.From([FINISH_DATE]) >= Date.AddDays(Date.From(DateTime.LocalNow()),7)) then "7 Forward" else null)

2 ACCEPTED SOLUTIONS
v-yadongf-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please try to use SWITCH function:

NewColumn = SWITCH (
    True(),
    NOT ( ISBLANK ( 'Tasks'[ACT_START_DATE] ) ) && ISBLANK ( 'Tasks'[ACT_END_DATE] ) )
        || 'Tasks'[ACT_START_DATE]
            <= TODAY () + 3, "3 Forward",
    'Tasks'[ACT_END_DATE] +7,  "7 Forward"
      )

 

If it doesn't work, can you share with me some screenshots of your data after hiding sensitive information and tell me what's your expected output?

 

Best regards,

Yadong Fang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hi,

Try this calculated column formula

NewColumn = IF((NOT(ISBLANK('Tasks'[ACT_START_DATE]))&&ISBLANK('Tasks'[ACT_END_DATE]))|| 'Tasks'[ACT_START_DATE]<= TODAY()+3,"3 Forward",if('Tasks'[ACT_START_DATE]<=today()+7,"7 Forward",BLANK()))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
v-yadongf-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please try to use SWITCH function:

NewColumn = SWITCH (
    True(),
    NOT ( ISBLANK ( 'Tasks'[ACT_START_DATE] ) ) && ISBLANK ( 'Tasks'[ACT_END_DATE] ) )
        || 'Tasks'[ACT_START_DATE]
            <= TODAY () + 3, "3 Forward",
    'Tasks'[ACT_END_DATE] +7,  "7 Forward"
      )

 

If it doesn't work, can you share with me some screenshots of your data after hiding sensitive information and tell me what's your expected output?

 

Best regards,

Yadong Fang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Here is my new column logic but its giving me an error at the end of the code
NewColumn = IF (
    ( NOT ( ISBLANK ( 'Tasks'[ACT_START_DATE] ) ) && ISBLANK ( 'Tasks'[ACT_END_DATE] ) )
        || 'Tasks'[ACT_START_DATE]
            <= TODAY () + 3, "3 Forward",
    'Tasks'[ACT_END_DATE] +7,  "7 Forward"

Hi,

Try this calculated column formula

NewColumn = IF((NOT(ISBLANK('Tasks'[ACT_START_DATE]))&&ISBLANK('Tasks'[ACT_END_DATE]))|| 'Tasks'[ACT_START_DATE]<= TODAY()+3,"3 Forward",if('Tasks'[ACT_START_DATE]<=today()+7,"7 Forward",BLANK()))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
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