March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello, I am trying to create a week range column in my date table. I got the start and end date columns in Power Query, changed their format to mm/dd/yyyy in Table view, and concatenated them but the leading 0's didn't stay.
I want the Week Range to show 01/02/2024-01/07/2024 so that when the column is sorted in a visual the week ranges are in the correct order by date. I also tried to sort the Week Range column by a date column and that didn't work because I have repeating values in the Week Range column.
Solved! Go to Solution.
Hi,
If you are OK with a DAX solution, then write this calculated column formula
Week range = format(Data[Start of week],"mm/dd/yyyy")&"-"&format(Data[End of week],"mm/dd/yyyy")
Hope this helps.
Hi @bernate ,
Below is my table:
The following DAX might work for you:
Week Range = COMBINEVALUES("-",FORMAT('Table'[StartOfWeek],"mm/dd/yyyy"),FORMAT('Table'[EndOfWeek],"mm/dd/yyyy"))
The final output is shown in the following figure:
Best Regards,
Xianda Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
If you are OK with a DAX solution, then write this calculated column formula
Week range = format(Data[Start of week],"mm/dd/yyyy")&"-"&format(Data[End of week],"mm/dd/yyyy")
Hope this helps.
Worked perfectly, thank you for your help!
hello @bernate
for leading zero, can you please change mm to MM.
for the ordering ,
i would suggest to create a start of week column, and sort the week range by this column.
let me know if this would help you .
best regards
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
125 | |
85 | |
69 | |
54 | |
45 |
User | Count |
---|---|
204 | |
106 | |
98 | |
65 | |
54 |