Forum Discussion
Help to filter Current week and next Week
- 6 years ago
Hi Anonymous ,
Sorry for my late respond, we can adjust the formula as below.
Column = VAR next = TODAY () + 7 VAR yn = YEAR ( next ) VAR yt = YEAR ( TODAY () ) VAR weeknumt = WEEKNUM ( TODAY (),2 ) VAR weeknun = WEEKNUM ( next,2 ) VAR wek = WEEKNUM ( 'date'[Date],2 ) RETURN IF ( OR ( yn = YEAR ( 'date'[Date] ) && weeknun = wek, yt = YEAR ( 'date'[Date] ) && weeknumt = wek&& WEEKDAY('date'[Date],2)<=5 ), "current week & next week", BLANK () )As the picture above, Sat and Sunday have been exculded for current week.
First create a date table and join it with you fact
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s.
In your date table have week number.
You can create a formula lagging seven days and it should work
before 7 day = CALCULATE(sum(Sales[Sales Amount]),dateadd('Date'[date],-7,DAY))
Refer
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p/881739
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601