Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi there ;
i need your kind and small help about below issue
i have table vision and in table vision there is column with week numbers as below .it starts from W-1 to W-53.this column's data type is text.When i want to sort from W-1 to W-53 , system is not sorting as i want .As you see below it is sorting wrongly :
when i use sorting function on the top of column it is not sorting properly , i want to sort as below , how can i solve this problem , could you pls help ?
W-1
W-2
W-3
W-4
...
...
...
thanks in advanve for your supports
Solved! Go to Solution.
ok. as you use Power Query you can replace #"Inserted Merged Column" step to
#"Inserted Merged Column" = Table.AddColumn(#"Changed Type4", "WeekName", each if [Week Number] > 9 then Text.Combine({"W-",Text.From([Week Number], "en-US")}) else Text.Combine({"W-0", Text.From([Week Number], "en-US")}))
dear @az38 ,
thanks for your reply but , is not there any other way ,leading 0 for week number else ?
dear @az38
i got week name with below date dataset formula :
let
Source = Query1(#date(2020, 1, 1), #date(2021, 12, 31), 1),
#"Inserted Start of Week" = Table.AddColumn(Source, "Start of Week", each Date.StartOfWeek([Date]), type date),
#"Added Custom" = Table.AddColumn(#"Inserted Start of Week", "IsToday", each if Date.IsInCurrentDay([Date]) then 1 else 0),
#"Changed Type" = Table.TransformColumnTypes(#"Added Custom",{{"IsToday", type logical}}),
#"Added Custom1" = Table.AddColumn(#"Changed Type", "IsCurrentYear", each if Date.IsInCurrentYear([Date]) then 1 else 0),
#"Changed Type1" = Table.TransformColumnTypes(#"Added Custom1",{{"IsCurrentYear", type logical}}),
#"Added Custom2" = Table.AddColumn(#"Changed Type1", "IsCurrentYearTillStartDateOfCurrentWeek", each if [IsCurrentYear] and [Date] < Date.StartOfWeek(Date.From(DateTime.LocalNow())) then 1 else 0),
#"Changed Type2" = Table.TransformColumnTypes(#"Added Custom2",{{"IsCurrentYearTillStartDateOfCurrentWeek", type logical}}),
#"Added Custom3" = Table.AddColumn(#"Changed Type2", "IsYTD", each if [IsCurrentYear] and [Date] <= Date.AddDays(Date.From(DateTime.FixedLocalNow()),-1) then 1 else 0),
#"Changed Type3" = Table.TransformColumnTypes(#"Added Custom3",{{"IsYTD", type logical}}),
#"Added Custom4" = Table.AddColumn(#"Changed Type3", "IsCurrentWeek", each if Date.IsInCurrentWeek([Date]) then 1 else 0),
#"Changed Type4" = Table.TransformColumnTypes(#"Added Custom4",{{"IsCurrentWeek", type logical}}),
#"Inserted Merged Column" = Table.AddColumn(#"Changed Type4", "WeekName", each Text.Combine({"W-", Text.From([Week Number], "en-US")}), type text)
in
#"Inserted Merged Column"
jus ti would like to sort without adding "0" , if it is possible
ok. as you use Power Query you can replace #"Inserted Merged Column" step to
#"Inserted Merged Column" = Table.AddColumn(#"Changed Type4", "WeekName", each if [Week Number] > 9 then Text.Combine({"W-",Text.From([Week Number], "en-US")}) else Text.Combine({"W-0", Text.From([Week Number], "en-US")}))
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 46 | |
| 42 | |
| 23 | |
| 18 |
| User | Count |
|---|---|
| 192 | |
| 125 | |
| 99 | |
| 67 | |
| 48 |