Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi friends,
I would like to caculate the % Growth Last N days/weeks/Months/Year regarding the relative Date Slicer.
For example:
- If the user selects last 1 week (calendar) from 14 feb to 20 Feb 2021
=> % growth = ((Sale from 14 feb to 20 Feb 2021) - (Sale from 7 feb to 13 Feb 2021) )/ (Sale from 7 feb to 13 Feb 2021)
- If the user selects last 1 week from 20 feb to 26 Feb 2021
=> % growth = ((Sale from 20 feb to 26 Feb 2021) - (Sale from 13 feb to 19 Feb 2021) )/ (Sale from 13 feb to 19 Feb 2021)
Any help is highly appreciated.
Thank you in advance.
Solved! Go to Solution.
Hi @tracytran91 ,
According to your description, I create this data:
Here are the steps you can follow:
1. Create calculated table.
Week = WEEKNUM('Table'[date])
2. Create measure.
Measure =
var _min=
MIN('Table'[date])
var _max=MAX('Table'[date])
var _sum1=CALCULATE(SUM('Table'[amount]),FILTER(ALL('Table'),'Table'[date]>=_min&&'Table'[date]<=_max))
var _sum2=CALCULATE(SUM('Table'[amount]),FILTER(ALL('Table'),'Table'[Week]=MAX('Table'[Week])-1))
return
DIVIDE(_sum1,_sum2)
3. Result.
You can downloaded PBIX file from here.
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.
Hi @tracytran91 ,
According to your description, I create this data:
Here are the steps you can follow:
1. Create calculated table.
Week = WEEKNUM('Table'[date])
2. Create measure.
Measure =
var _min=
MIN('Table'[date])
var _max=MAX('Table'[date])
var _sum1=CALCULATE(SUM('Table'[amount]),FILTER(ALL('Table'),'Table'[date]>=_min&&'Table'[date]<=_max))
var _sum2=CALCULATE(SUM('Table'[amount]),FILTER(ALL('Table'),'Table'[Week]=MAX('Table'[Week])-1))
return
DIVIDE(_sum1,_sum2)
3. Result.
You can downloaded PBIX file from here.
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.
@tracytran91 , You need to create a few measures to that. They can use time intelligence and date table. Refer blog
You can also use trailing measures
Last Day = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])-1))
Week behind = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])-7))
Month behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Month))
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA
Power BI — Qtr on Qtr with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-qtd-questions-time-intelligence-2-5-d842063da839
https://www.youtube.com/watch?v=8-TlVx7P0A0
Power BI — Month on Month with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
https://www.youtube.com/watch?v=6LUBbvcxtKA
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-La...
https://www.youtube.com/watch?v=pnAesWxYgJ8
Day Intelligence - Last day, last non continous day
https://medium.com/@amitchandak.1978/power-bi-day-intelligence-questions-time-intelligence-5-5-5c324...
User | Count |
---|---|
131 | |
108 | |
101 | |
67 | |
64 |
User | Count |
---|---|
137 | |
115 | |
102 | |
71 | |
61 |