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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

How to get a specific date

I have a column I need to filter. As of Now I have it like this:

 

BeforeToday_MI = IF(Query_Util[MoveInDate].[Date] < TODAY(), True, False) 
 
It returns True if MoveInDate column has dates prior to today. However, I want the function to return true if the date is before Today AND the day is not Saturday or Sunday; in other words, the date belong to a weekday and not a weekend.

 

I tried this but it's giving me error: 

BeforeToday_MI = IF(Query_Util[MoveInDate].[Date] < TODAY() && VALUE(Query_Util[MoveInDate].[Day]) <> "Saturday", True, False)
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous ,

 

BeforeToday_MI = IF( datevalues(Query_Util[MoveInDate]) < TODAY() && weekday(Query_Util[MoveInDate],2) <6 , True, False) 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous ,

 

BeforeToday_MI = IF( datevalues(Query_Util[MoveInDate]) < TODAY() && weekday(Query_Util[MoveInDate],2) <6 , True, False) 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

What if I want to get the days that are not Saturday or Sunday?

 

(My bad; I forgot to include that specification before. I need work days. Your code works perfectly; I just need to act the condition of filtering out Sunday as well.)

Hi @Anonymous ,

 

Did you get your problem solved? If it was solved, please mark it as a solution so that more people can find it. If not, refer to the following.

 

weekday(Query_Util[MoveInDate],2) return result follow the following rule.

week begins on Monday (1) and ends on Sunday (7).

 

If you only want filter out  sunday, then weekday(Query_Util[MoveInDate],2) <7. Or enter the day you want like this:

weekday(Query_Util[MoveInDate],2) = 1 &&

weekday(Query_Util[MoveInDate],2) = 2 &&

weekday(Query_Util[MoveInDate],2) = 3 &&

weekday(Query_Util[MoveInDate],2) = 4

 

More detail you can refer this function.

WEEKDAY function (DAX) - DAX | Microsoft Docs

 

Best Regards

Community Support Team _ chenwu zhu

 

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

 

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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