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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
KevinMorneault
Helper II
Helper II

DAX Query - Due by last week - Week Begin on Saturday

Hi Everyone

I am kind fo new to Dax and trying to get my head around it. I need to create a dax query which would provide me records  that are due by last week. 

This is the actual query i have in power query, i am trying to convert into Dax. 

 

DWH_INV_INVESTMENT_SELECT = Table.AddColumn(DWH_INV_INVESTMENT_SELECT_1, "Due by Last Week", each if Date.From([schedule_finish]) < Date.StartOfWeek(Date.From(DateTime.LocalNow()), Day.Saturday) then "Yes" else "No"),

 

 

1 ACCEPTED SOLUTION

Hi @KevinMorneault ,

Please try:

Column = IF('DWH_INV_INVESTMENT'[schedule_finish]<(TODAY()-WEEKDAY(TODAY())),"Yes","No")

Output:

vcgaomsft_0-1700533282324.png

Best Regards,
Gao

Community Support Team

 

If there is any 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 us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

3 REPLIES 3
KevinMorneault
Helper II
Helper II

Hi All

 

Here's what i have tried but still has an error, i have tried several approach but so far unsucsseful so far 

 

Due by last week = IF(DWH_INV_INVESTMENT[schedule_finish].[Date] < DWH_INV_INVESTMENT[schedule_start](TODAY(),2),"Yes","No")

 

KevinMorneault_0-1700174645672.png

 

Hi All

 

Here's another update, this one doesn't produce any error and do generate result but only have no as a result and i should see some Yes, i needed to remove Today() which i would need it, but if i keep it, generate an error

Here's the updated query

 

Duebylastweek = IF(DWH_INV_INVESTMENT[schedule_finish].[Date]< DATEADD(DWH_INV_INVESTMENT[schedule_start].[Date],-2,DAY), "Yes","No")
 

 

Hi @KevinMorneault ,

Please try:

Column = IF('DWH_INV_INVESTMENT'[schedule_finish]<(TODAY()-WEEKDAY(TODAY())),"Yes","No")

Output:

vcgaomsft_0-1700533282324.png

Best Regards,
Gao

Community Support Team

 

If there is any 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 us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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