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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Need help rewriting this in DAX.

i get an error saying i have too many arguments. any  one able to tell me where i am going wrong?
 
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")  
2 ACCEPTED SOLUTIONS
hnguy71
Super User
Super User

hnguy71_0-1667068109341.png

 

@Anonymous What's the logic you need?



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

View solution in original post

mangaus1111
Solution Sage
Solution Sage

For example

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

View solution in original post

4 REPLIES 4
Fowmy
Super User
Super User

@Anonymous 

I would use SWITCH to make it readable 

 

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"
)

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

mangaus1111
Solution Sage
Solution Sage

For example

NewColumn =  SWITCH ( TRUE(),
                    ( NOT ( ISBLANK ( 'Tasks'[ACT_START_DATE] ) ) && ISBLANK ( 'Tasks'[ACT_END_DATE] ) ) || 'Tasks'[ACT_START_DATE]<= TODAY () + 3, "3 Forward",
                     MAX('Tasks'[ACT_START_DATE]) <= TODAY () + 7,  "7 Forward" 
                   )
 
mangaus1111
Solution Sage
Solution Sage

Hi @Anonymous ,

the IF function accept maximum 3 arguments and you have used 4.

Try to use SWITCH instead.

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

hnguy71
Super User
Super User

hnguy71_0-1667068109341.png

 

@Anonymous What's the logic you need?



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

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.

Top Solution Authors
Top Kudoed Authors