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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
rhaberkorn4
New Member

Filer Day.IsInCurrentWeek to start on Monday

Hello,

 

I am trying to crete a simple spread sheet using and ODBC connection and Power querry. I data dump the ODBC connection into excel and then use that table in Power querry. 

 

There is a Day of Week going back at least (2) years. I really only care about 'This Current' Week. I filter on 'Day.IsInCurrentWeek' and it starts on a Sunday. I would like it to start Monday to Sunday. 

 

I have read multiple forms and watched YouTube but my M Coding is not where it needs to be.  Any help would be apprecietated. Thank you

1 ACCEPTED SOLUTION

Use this for your last step

= Table.SelectRows(#"Reordered Columns3", each Date.IsInCurrentWeek(Date.AddDays([Day of Week],-1)))

View solution in original post

8 REPLIES 8
Vijay_A_Verma
Super User
Super User

If you want to use Monday as the start day for Date.IsInCurrentWeek, use 

Date.IsInCurrentWeek(Date.AddDays([Date],-1))

Hence, you will have to insert following step where #"Changed Type" is previous step

 

= Table.SelectRows(#"Changed Type", each Date.IsInCurrentWeek(Date.AddDays([Date],-1)))

 

Thank you,

 

I tried to enter the code you porovided into the advanced editor and it is giving me error.  I have attached the current advianced editor code.

 

rhaberkorn4_0-1708011799172.png

 

I can't see Date.IsInCurrentWeek anywhere in your code? If you could highlight, that would be great.

Thank you. At the very bottom. Let me know if this is not what you are looking for

rhaberkorn4_0-1708025671653.png

 

Go to UI - Click on Filtered Rows1 in right pane - In Formula bar, delete everything and copy my code..

THANK YOU! I am sorry if this was very frustrating. I really apprecieate your help. This worked. 

 

Thank you thank you thank you!

Use this for your last step

= Table.SelectRows(#"Reordered Columns3", each Date.IsInCurrentWeek(Date.AddDays([Day of Week],-1)))

I am so sorry. I am not getting this. Does that code go in place of the #"Filtered Rows1" or after? Does the very last line "in #Filtered Rows1" need to be changed after that. I put the code in and I just get this response.

 

rhaberkorn4_0-1708088144945.png

 

rhaberkorn4_1-1708088159839.png

 

 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

Top Solution Authors
Top Kudoed Authors