Forum Discussion
Anonymous
4 years agoNot applicable
Comparing different dates same time period using slicers to show trending previous vs current period
Hi, I have a sample pbix here that I am comparing holiday season for example Thanksgiving(TG) from 2011 vs 2012 with slicers for days before and after. I want to get my graphs to show Trending c...
- Anonymous4 years ago
Hi Anonymous ,
I see. So we need to add the date difference to the formula.
Holiday Between max =var HolStart = max(Holidays[Date]) - 'Days Before'[Days Before Value]var HolEnd = max(Holidays[Date]) + 'Days After'[Days After Value]var Hol_diff = datediff(MIN(Holidays[Date]),MAX(Holidays[Date]),DAY)var _max = CALCULATE(sum(Sales[SalesAmount]),FILTER(ALL('Sales'),Sales[DateKey]>=HolStart&&sales[DateKey]<=HolEnd&&Sales[DateKey]=SELECTEDVALUE('Calendar'[DateKey])+Hol_diff))RETURNIF(SELECTEDVALUE('Calendar'[DateKey])>=HolStart-Hol_diff&&SELECTEDVALUE('Calendar'[DateKey])<=HolEnd-Hol_diff,_max)Best Regards,Jay
AllisonKennedy
Community Champion
4 years agoAnonymous
See if this post helps: https://excelwithallison.blogspot.com/2021/09/power-bi-forecasting-with-irregular.html
Should be similar to what you're trying to do.
- Anonymous4 years agoNot applicable
thank you... but my little brain is having a hard time making the connection.
I also google a lot of places and I look for 'hot' areas to clue in(before actually diving into the code) on to help me and I'm not making the connection...