Snippets Collections
Sales-WTD = 

CALCULATE( [Total Sales], 
	FILTER( ALL('Calendar'),
		'Calendar'[Week Rank] = MAX( 'Calendar'[Week Rank] ) && 
		'Calendar'[Weekday] <= MAX( 'Date'[Weekday] ) 
		) 
	)
Sales-WTD = 

VAR CD =
    LASTDATE( 'Calendar'[Date] )

VAR CY =
    MAX( 'Calendar'[Year] )
    
VAR WeekDayNo =
    WEEKDAY( LASTDATE( 'Calendar'[Date] ), 3 )

RETURN
CALCULATE(
    [Total Sales],
    DATESBETWEEN(
        'Calendar'[Date],
        DATEADD(
            CD, 
            -1 * WeekDayNo, DAY ), 
            CD),
    'Calendar'[Year] = CY
)

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension