Forum Discussion
Variation week over week with a baseline
- Anonymous2 years ago
Hi Rachitik67 ,
Here are the steps you can follow:
You can use the following dax.
Calculated column:
Column = var _currentweek= MAXX(ALL('Table'),'Table'[No de Semaine]) var _currentvalue= SUMX( FILTER(ALL('Table'),'Table'[No de Semaine]=_currentweek),[Inscr_this_week]) return DIVIDE( _currentvalue - 'Table'[Inscr_this_week],'Table'[Inscr_this_week])Measure:
Measure = var _currentweek= MAXX(ALL('Table'),'Table'[No de Semaine]) var _currentvalue= SUMX( FILTER(ALL('Table'),'Table'[No de Semaine]=_currentweek),[Inscr_this_week]) return DIVIDE( _currentvalue - MAX('Table'[Inscr_this_week]),MAX('Table'[Inscr_this_week]))Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Have these new columns in Date Table, Week Rank is Important in Date/Week Table
Week Rank = RANKX('Date','Date'[Week Start date],,ASC,Dense)
OR
Week Rank = RANKX('Date','Date'[Year Week],,ASC,Dense) //YYYYWW format
These measures can help
This Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))
Last Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))
Max week
Have these new columns in Date Table, Week Rank is Important in Date/Week Table
Week Rank = RANKX('Date','Date'[Week Start date],,ASC,Dense)
OR
Week Rank = RANKX('Date','Date'[Year Week],,ASC,Dense) //YYYYWW format
These measures can help
Max Week =
Var _max = Maxx(allselected('Date'), 'Date'[Week Rank])
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=_max ))
Power BI — Week on Week and 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
https://www.youtube.com/watch?v=pnAesWxYgJ8
Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
I am sorry, but i don't see any variation calculation with the current week baseline.