Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

WoW change but it shows as blank

Hi guys,

 

I'm trying to do a WoW change for bag packing rate, but it shows up as blank. There's only one date in each week.

 

Here's the DAXs i created:

 

WoW change:

 

WoW Uplift_Packingrate =
VAR LW_PackingRate =
    CALCULATE(
        [Packing Rate],
        FILTER(
            All('Training Performance'),
            'Training Performance'[As of ]=[LW_date])
    )
RETURN
    DIVIDE([PackingRate_TW]-LW_PackingRate, LW_PackingRate,0)
 
Here's the DAX for LW_Date:
 
LW_date =
var TW_date = max('Training Performance'[As of ])
return CALCULATE(
    max('Training Performance'[As of ]),
    'Training Performance'[As of ] < TW_date
)
 
Do you know how to solve this?
 
Thanks a lot
Wenlu
1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , For Week on Week, use a date table and Week Rank or Week table and Week Rank. Rank on Week Start Date or Year Week (YYYYWW)

example

Column needed

Week Rank = RANKX(all('Date'),'Date'[Week Start date],,ASC,Dense)

oe

Week Rank = RANKX(all('Date'),'Date'[Year Week],,ASC,Dense)

 

Measure
This Week = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))
Last Week = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))
Last year Week= CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=(max('Date'[Week Rank]) -52)))
last two weeks = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]<=max('Date'[Week Rank])-1

 

Refer

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

 

 

 

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.