Forum Discussion
How to do Percent Change for Bi-weekly Data
Hey All,
This one has me puzzled. I currently do Bi-Weekly reports for a client and want to start incorporating % change between the reporting data which we pull in 2 increments starting on a Monday and going to Sunday. Has anyone ever dealt with this or done something similar?
Phil
Anonymous , New column in date table
First Monday in the calendar
First =var _min= min(Date[Date])
return
_min+-1*WEEKDAY(_min,2)+1
Now Bi week
Bi week no = Quotient(datediff(First , [Date], day), 14) +1
Bi Week Date = First + (Bi week no -1) * 14
Bi week Year = year([Bi Week Date]) * 100 + [Bi week no]
Week Rank = RANKX(all('Date'),'Date'[Bi week Year],,ASC,Dense) //YYYYWW format
This bi Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))
Last bi Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))Same approach as week using week rank
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145sPower 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
2 Replies
- amitchandakSuper User
Anonymous , New column in date table
First Monday in the calendar
First =var _min= min(Date[Date])
return
_min+-1*WEEKDAY(_min,2)+1
Now Bi week
Bi week no = Quotient(datediff(First , [Date], day), 14) +1
Bi Week Date = First + (Bi week no -1) * 14
Bi week Year = year([Bi Week Date]) * 100 + [Bi week no]
Week Rank = RANKX(all('Date'),'Date'[Bi week Year],,ASC,Dense) //YYYYWW format
This bi Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))
Last bi Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))Same approach as week using week rank
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145sPower 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 - AnonymousNot applicable
When I do
This bi Week Clicks = CALCULATE(sum('Performance Data'[Clicks]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))The value returns 0. Same when I do last week clicksHere is sample data https://we.tl/t-ZX7IoTOitI