Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I have table named 'Calendar'
It has colums named: CalendarDate, CalendarWeekBeginningDate, CalendarWeekEndingDate
In order for example: 05/02/22, 05/02/22, 05/08/22
05/01/22, 04/25/22, 05/01/22
Today is 5/2/2022 and still we are in the week. I want to get 04/25/22, 05/01/22 as _weekBeginingPriorWeek and _weekEndingPriorWeek in a DAX function to use as variables.
When Today is 5/8/2022 I want to get 05/02/22, 05/08/22 as _weekBeginingPriorWeek and visa versa
I use AAS model to create DAX measures, how can i get those two specific days ?
Hi @Anonymous ,
How about this:
weekBeginingPriorWeek = TODAY() - 6 - WEEKDAY( TODAY() ,2)
weekEndingPriorWeek = TODAY() - WEEKDAY( TODAY() ,2)
Not sure whether you wanna use the formulars as above meaning based on todays date, or if you'd like to use your own date column. If the latter fits your case, then just substitute TODAY() with whatever date column you have in your model 🙂
Let me know if this helps!
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
Did I answer your question❓➡️ Please, mark my post as a solution ✔️ |
Also happily accepting Kudos 🙂 |
Feel free to connect with me on LinkedIn! | |
#proudtobeasuperuser | |
I guess It works
I need to try it on again.
For example : 1st column how many items sold on that day, 2nd column calendar date, 3rd column 1st category item.
Actually, I'm gonna use those 2 variables in a dax function to filter in the first column
such as bring me the how many sold item between those two variables ( beginning date of prior week " monday" to ending date of prior week "sunday" )
What I shared the Dax code brings me the total, not seperated day by day.
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
7 | |
7 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |