cancel
Showing results for
Did you mean:
Anonymous
Not applicable

## Measure to always filter back to start of a specific day of the week

Hi,

I am trying to create a column for my report that would calculate always to the previous thursday at 19:30 pm

For the past seven days i used this but i want it to go only until thursday, even if its a friday

CurProdWeek = DIVIDE(CALCULATE(SUM(Primary[Value]), Primary[Time] > today()-7), CALCULATE(SUM(Primary[HoursInPeriod]), Primary[Time] > today()-7))*100

The calculation for what I need works except I dont know how to filter to only the previous Thursday at 19:30. What I set up also needs to be dynamic, so every week when someone opens it up its correct.

Also need another column to do the previous week which would be ending the previous Thursday at 19:30 and begining the thursday before that one at 19:30

Any help would be greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team

## Re: Measure to always filter back to start of a specific day of the week

@Anonymous,

You may refer to the DAX below.

```Measure =
VAR d =
TODAY ()
VAR n =
WEEKDAY ( d )
RETURN
d - n
+ 5
- IF ( n > 5, 0, 7 )
+ TIME ( 19, 30, 0 )
```
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Community Support Team

## Re: Measure to always filter back to start of a specific day of the week

@Anonymous,

You may refer to the DAX below.

```Measure =
VAR d =
TODAY ()
VAR n =
WEEKDAY ( d )
RETURN
d - n
+ 5
- IF ( n > 5, 0, 7 )
+ TIME ( 19, 30, 0 )
```
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Announcements

#### New Kudos Given Badges Coming

We're rolling out new Kudos Given badges. Find out how many Kudos you've given.

#### November 2019 Community Highlights

Get an overview of the events and great community content from November.

#### Power Platform World Tour

Find out where you can attend!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)