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
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
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.

Top Solution Authors