Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
hello ,
im trying to create a column that sorts weeks according to dates rather than week name.
ex. w1 2022 would be : january1-2022 till january7-2022
w2 would be be january8-2022 till january14-2022
w3 woud be january15-2022 till january21-2022
where W1 should always be first 7 days of the begining of the year
i was trying to use weeknum function but its sorting weeks according to weekdays from Sunday till Saturday
Solved! Go to Solution.
@lawada , Try columns like
Week No =
Var _start = date(Year([Date]),1,1)
return
quotient(datediff(_start,[Date],day) ,7)+1
Week Year = Year([Date])*100 + [Week No]
Week Start Date = date(Year([Date]),1,1) + ([Week NO]-1) * 7
if(isfiltered('Table Name'[Column name]), Selectedvalue('Table Name'[Column name]), "All")
Week That Resets Yearly
https://community.powerbi.com/t5/Community-Blog/Week-That-Resets-Yearly-Decoding-Date-and-Calendar-3...
Hi,
WEEKNUM accepts second parameter where you can define the start date of the week. I recommend cheking this documentation about the function: https://docs.microsoft.com/en-US/dax/weeknum-function-dax
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/
Proud to be a Super User!
the documentation explains the sorting according to weekdays as well. im trying to do something different and sort by dates in the calender as the example i mentiond . any solution for that ?
@lawada , Try columns like
Week No =
Var _start = date(Year([Date]),1,1)
return
quotient(datediff(_start,[Date],day) ,7)+1
Week Year = Year([Date])*100 + [Week No]
Week Start Date = date(Year([Date]),1,1) + ([Week NO]-1) * 7
if(isfiltered('Table Name'[Column name]), Selectedvalue('Table Name'[Column name]), "All")
Week That Resets Yearly
https://community.powerbi.com/t5/Community-Blog/Week-That-Resets-Yearly-Decoding-Date-and-Calendar-3...
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 9 | |
| 6 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 21 | |
| 14 | |
| 9 | |
| 5 | |
| 5 |