cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GenericUser1 Regular Visitor
Regular Visitor

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

Accepted Solutions
Moderator v-yuezhe-msft
Moderator

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

@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.
3 REPLIES 3
GenericUser1 Regular Visitor
Regular Visitor

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

or maybe something like:

 

today - date.isincurrentweek ?????

Moderator v-yuezhe-msft
Moderator

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

@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.
GenericUser1 Regular Visitor
Regular Visitor

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

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