DAX measure for WTD calculation

The following DAX measure will return the week-to-date total from a PowerPivot table containing only a Date and SUM column. No calendar table or other calculated fields are needed with this measure.

WTD:=CALCULATE(SUM([Sum]),DATESINPERIOD(Table1[Date],LastDate(Table1[Date]),-WEEKDAY(LastDate(Table1[Date])),DAY))

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s