Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
39 | |
20 | |
19 | |
16 | |
15 |
User | Count |
---|---|
49 | |
26 | |
22 | |
17 | |
16 |