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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
GenericUser1
Helper I
Helper I

Can anyone confirm that these measures exclude data from the current week? or any suggestions?

IsInLastWeek

=if([IsInCurrentYear] && (weeknum(now()) -1) = [WeekOfYearNumber, 1, 0))

 

 

or

 

 

IsLast7days = if(and([date] > = [Today] - 7, [date] = [today], 1, 0)

1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

@GenericUser1,


You can use the following methods to exclude date from current week.

1. In Power BI Query Editor, add a custom column. Then filter the custom column.

=Date.IsInCurrentWeek([Date])

1.PNG2.PNG

2. Create a calculated column using dax below. Then filter the table using the column or create slicer/filters using this column.

Column = IF(WEEKNUM(Table[Date])=WEEKNUM(NOW()),1,0)

3.PNG

Regards,
Lydia

Community Support Team _ Lydia Zhang
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

3 REPLIES 3
v-yuezhe-msft
Employee
Employee

@GenericUser1,


You can use the following methods to exclude date from current week.

1. In Power BI Query Editor, add a custom column. Then filter the custom column.

=Date.IsInCurrentWeek([Date])

1.PNG2.PNG

2. Create a calculated column using dax below. Then filter the table using the column or create slicer/filters using this column.

Column = IF(WEEKNUM(Table[Date])=WEEKNUM(NOW()),1,0)

3.PNG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

thanks, figured it out yesterday 🙂 first one works perfectly, while taking into account the week starting from mon to sunday. 

GenericUser1
Helper I
Helper I

or maybe something like:

 

today - date.isincurrentweek ?????

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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