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.
Hi All -
I understand using power BI filter, we can filter the date to get last calendar weeks.
But the problem that i faced using existing filters, the count start from Sunday to Saturday while my company cycle data is from Monday to Sunday.
Can you please help to assist to create filter in measure/dax to get :
- 1 last calendar week (Data on Dec 9 - Dec 15)
- 2 last calendar week (Data on Dec 2 - Dec 8 )
Thanks
Solved! Go to Solution.
Hello @rezaaditia,
You can create a calculated column as below:
Calendar Week = WEEKNUM ( [Date] , 2)
Current Year = IF(YEAR(Dates[Date])=YEAR(NOW()),1,0)
-1 Last Week = IF(Dates[Current Year]=1 && (WEEKNUM(TODAY())-1)=Dates[Calendar Week],1,0)
-2 Last Week = IF(Dates[Current Year]=1 && (WEEKNUM(TODAY())-2)=Dates[Calendar Week],1,0)
Hope this helps.
Hello @rezaaditia,
You can create a calculated column as below:
Calendar Week = WEEKNUM ( [Date] , 2)
Current Year = IF(YEAR(Dates[Date])=YEAR(NOW()),1,0)
-1 Last Week = IF(Dates[Current Year]=1 && (WEEKNUM(TODAY())-1)=Dates[Calendar Week],1,0)
-2 Last Week = IF(Dates[Current Year]=1 && (WEEKNUM(TODAY())-2)=Dates[Calendar Week],1,0)
Hope this helps.
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 |
---|---|
112 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |