Forum Discussion
dax week-to-date last week as a variable
- 6 years ago
Anonymous , please refer if my blogs on the same can help
Power BI — WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-Last-Week/ba-p/1051123 - 6 years ago
Hi Anonymous ,
You may create measures like DAX below.
WTD = CALCULATE ( SUM ( Sales[Amount] ), FILTER ( ALL ( 'Calendar' ), WEEKNUM ( 'Calendar'[Date] ) = WEEKNUM ( MAX ( 'Calendar'[Date] ) ) && WEEKDAY ( 'Calendar'[Date] ) <= WEEKDAY ( MAX ( 'Calendar'[Date] ) ) ) ) LWTD = CALCULATE ( SUM ( Sales[Amount] ), FILTER ( ALL ( 'Calendar' ), WEEKNUM ( 'Calendar'[Date] ) = WEEKNUM ( MAX ( 'Calendar'[Date] ) ) - 1 && WEEKDAY ( 'Calendar'[Date] ) <= WEEKDAY ( MAX ( 'Calendar'[Date] ) ) ) )Best Regards,
Amy
Community Support Team _ Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
You may create measures like DAX below.
WTD =
CALCULATE (
SUM ( Sales[Amount] ),
FILTER (
ALL ( 'Calendar' ),
WEEKNUM ( 'Calendar'[Date] ) = WEEKNUM ( MAX ( 'Calendar'[Date] ) )
&& WEEKDAY ( 'Calendar'[Date] ) <= WEEKDAY ( MAX ( 'Calendar'[Date] ) )
)
)
LWTD =
CALCULATE (
SUM ( Sales[Amount] ),
FILTER (
ALL ( 'Calendar' ),
WEEKNUM ( 'Calendar'[Date] )
= WEEKNUM ( MAX ( 'Calendar'[Date] ) ) - 1
&& WEEKDAY ( 'Calendar'[Date] ) <= WEEKDAY ( MAX ( 'Calendar'[Date] ) )
)
)
Best Regards,
Amy
Community Support Team _ Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
many2 tks, v-xicai & amitchandak .
krgds, -nik