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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply

Flag to show only complete weeks

H - I have data which is refreshed daily, but there is an element of our app which shows data on a weekly basis (Monday to Sunday).  If the app is refreshed on, say, the Tuesday, I don't want any of this 'partial' week to show.  I only just want to show complete weeks, not partial weeks.

 

I have a date table, so just really need some ideas as to how to create this, either in Power Query, or as a DAX expression?

 

Many thanks!

2 ACCEPTED SOLUTIONS
johnt75
Super User
Super User

You could create a column like

Before Current Week =
VAR StartCurrentWeek =
    TODAY () - WEEKDAY ( TODAY (), 2 ) + 1
VAR Result = 'Date'[Date] < StartCurrentWeek
RETURN
    Result

View solution in original post

v-xingshen-msft
Community Support
Community Support

Hi All,
Firstly  johnt75 thank you for your solution!
And @Creative_tree88 ,According to your question, you can also do it in power query to keep the complete week, we first calculate the weekend date for each row, then in another column we use to mark the week as complete or not, and finally in desktop, we filter the data by IsCompleteWeek column to show only the data with value 1.

 

EndOfWeek = Date.EndOfWeek([Date], Day.Sunday)
if Date.From(DateTime.LocalNow()) >= [EndOfWeek] then 1 else 0

 

vxingshenmsft_2-1736733499570.png

vxingshenmsft_3-1736733522570.png

Hope it helps!

Best regards,
Community Support Team_ Tom Shen

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

 

View solution in original post

2 REPLIES 2
v-xingshen-msft
Community Support
Community Support

Hi All,
Firstly  johnt75 thank you for your solution!
And @Creative_tree88 ,According to your question, you can also do it in power query to keep the complete week, we first calculate the weekend date for each row, then in another column we use to mark the week as complete or not, and finally in desktop, we filter the data by IsCompleteWeek column to show only the data with value 1.

 

EndOfWeek = Date.EndOfWeek([Date], Day.Sunday)
if Date.From(DateTime.LocalNow()) >= [EndOfWeek] then 1 else 0

 

vxingshenmsft_2-1736733499570.png

vxingshenmsft_3-1736733522570.png

Hope it helps!

Best regards,
Community Support Team_ Tom Shen

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

 

johnt75
Super User
Super User

You could create a column like

Before Current Week =
VAR StartCurrentWeek =
    TODAY () - WEEKDAY ( TODAY (), 2 ) + 1
VAR Result = 'Date'[Date] < StartCurrentWeek
RETURN
    Result

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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