Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Qlik Weekstart function into DAX

Hi Team,

 

I have a qlik expression and I need to convert it into equivalent DAX.But there is no Weekstart dax available in PBI Desktop

 

if(ReportingCommitments[RPT_RequiredDate] >= Today() && ReportingCommitments[RPT_RequiredDate] <= Weekstart(Today()) + 98 && ReportingCommitments[RPT_StatusId] <> 60, "Due in 1-16 Weeks",
if(ReportingCommitments[RPT_RequiredDate] >= Today() && ReportingCommitments[RPT_RequiredDate] > weekstart(Today()) + 98 && ReportingCommitments[RPT_StatusId] <> 60, "Due in more than 16 weeks",""
))

  • Hi Anonymous,

     

    You may try this Calculated column.

    DueInWeeks =
    VAR WeekStart =
        TODAY () - WEEKDAY ( TODAY (), 3 )
    VAR Condition_ =
        ReportingCommitments[RPT_RequiredDate] >= TODAY ()
            && ReportingCommitments[RPT_StatusId] <> 60
    RETURN
        IF (
            Condition_
                && ReportingCommitments[RPT_RequiredDate] <= ( WeekStart + 98 ),
            "Due in 1-16 Weeks",
            IF (
                Condition_
                    && ReportingCommitments[RPT_RequiredDate] > ( WeekStart + 98 ),
                "Due in more than 16 weeks",
                ""
            )
        )

     

    Then, the result looks like this.

     

    Also, attach the pbix file as reference. Hope it helps.

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let me know. Thanks a lot!

     

    Best Regards,

    Community Support Team _ Caiyun

2 Replies