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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
Memorable Member
Memorable Member

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
Memorable Member
Memorable Member

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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