Solved! Go to Solution.
Hi,
Please use this formula, to make your solution working.
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
What if you just store that column as a number instead and take off the "WK" part?
Hi There,
I was getting the same issue with SharePoint column being set as a number only.
The outcome in powerbi was still doing the same
EG
1
2
21
24
26
3
34
4
5
7
Hi,
Please use this formula, to make your solution working.
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
Ive just doubled check this and any date after march and it doesnt work for some reason?
I see how this works if the first day of the week is Monday. How do you adjust the following if the first day of the week is Sunday?
RoundDown(
(RoundUp (
Now() - Date(
Year(Now() - Weekday(Now() - 1) + 4),
1,
3
),
0
) + Weekday(
Date(
Year(Now() - Weekday(Now() - 1) + 4),
1,
3
)
) + 5) / 7,
0
)
Thanks,
Scott
<rem
Hi, do you know how to modify your formula for calendars where the first week of the year is the week where January 1st falls? Using your formula as-is gives me that 1/1/2021 is 20WW53 when in my company it should be 21WW01. Thank you. @kbilakanti
You can use the fact that Value(Today()) returns an integer that is in milliseconds, so the following gives you the week number - just change the StartOfWeek.Monday to whatever you need
RoundUp((
((Value(Date(Year(varDate),Month(varDate),Day(varDate))) - Value(Date(Year(varDate),1,1))) / 86400000) // Days into year
+ Weekday(Date(Year(varDate),1,1),StartOfWeek.Monday) // Offset for day of week on 1st Jan
) / 7 // Divide by days in a week
,0) // Round Up to get the week number (e.g. if 2.5 - it means we are half way through the 3rd week, so return 3)
hth,
Scott
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
200 | |
69 | |
50 | |
46 | |
20 |
User | Count |
---|---|
258 | |
121 | |
84 | |
79 | |
69 |