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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

How can i rewrite the below query in DAX

I am trying to re write this query from POWER query using DAX and i cant figure out the syntax. can anyone point me in the right direction?

= Table.AddColumn(Source, "Custom", each if((Date.From([ACT_START_DATE]) <>"" ) and (Date.From([ACT_END_DATE]) = "") or
(Date.From([START_DATE]) <= Date.AddDays(Date.From(DateTime.LocalNow()),2))) then (Date.From(Date.AddDays([FINISH_DATE],-1))) else null)

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

try

New column =
IF (
    ( NOT ( ISBLANK ( 'Table'[start date] ) ) && ISBLANK ( 'Table'[End date] ) )
        || 'Table'[start date]
            <= TODAY () + 2,
    'Table'[End date] - 1
)

View solution in original post

1 REPLY 1
johnt75
Super User
Super User

try

New column =
IF (
    ( NOT ( ISBLANK ( 'Table'[start date] ) ) && ISBLANK ( 'Table'[End date] ) )
        || 'Table'[start date]
            <= TODAY () + 2,
    'Table'[End date] - 1
)

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.