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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi @shahiddcs ,
Here are the steps you can follow:
If you don't have many [Class] types, try entering them manually:
1. Enter data – create a sort table.
2. In Power Query -- Add Column – Index Column – From 1.
3. Joining a relationship between two tables.
4. Select [Class] – Sort by – [Index].
If you have a large number of [Class] types that do not lend themselves to manual entry, you can use the following:
1. Create calculated table.
Table 2 =
var _table1=
DISTINCT('Table'[Class])
var _table2=
ADDCOLUMNS(
_table1,"index",
IF(
CONTAINSSTRING(
[Class],"year")=TRUE(),
VALUE(
RIGHT(
[Class],LEN([Class])-LEN("year "))),BLANK()))
return
ADDCOLUMNS(
_table2,"rank",IF([index]=BLANK(),MAXX(_table2,[index])+1,[index]))
2. Joining a relationship between two tables.
3. Select [Class] – Sort by column – [rank].
4. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @shahiddcs ,
Here are the steps you can follow:
If you don't have many [Class] types, try entering them manually:
1. Enter data – create a sort table.
2. In Power Query -- Add Column – Index Column – From 1.
3. Joining a relationship between two tables.
4. Select [Class] – Sort by – [Index].
If you have a large number of [Class] types that do not lend themselves to manual entry, you can use the following:
1. Create calculated table.
Table 2 =
var _table1=
DISTINCT('Table'[Class])
var _table2=
ADDCOLUMNS(
_table1,"index",
IF(
CONTAINSSTRING(
[Class],"year")=TRUE(),
VALUE(
RIGHT(
[Class],LEN([Class])-LEN("year "))),BLANK()))
return
ADDCOLUMNS(
_table2,"rank",IF([index]=BLANK(),MAXX(_table2,[index])+1,[index]))
2. Joining a relationship between two tables.
3. Select [Class] – Sort by column – [rank].
4. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @shahiddcs
It is sorting based on Text order. If you see Overall, Year 10,Year 11 and so on.
If you want to sort it according to your need the you have to create Custom column then add that column into chart so it will then proper sorting values.
create calcualted column:
Sorting=
my table is like below
Class Year
Year 7 2020-2021
year 7 2021-2022
year 7 2022-2023
Year8 2020-2021
yera 8 2021-2022
year 8 2022-2023
yer 9 2020-2021
year 9 2021-2022
year 9 2022-2023
year10 2020-2021
year 10 2021-2022
year 10 2022-2023
year 11 2020-2021
year11 2021-2022
yer 11 2022-2023
overall 2020-2021
overall 2021-2022
overall 2022-2023
how to make new culumn as per your instruction
You will need to tell Power BI how your used columns should be ordered. Go to the Table view, select the column and click on "Sort by column". If you dont have an adequate column for sorting, you need to create one.
Br
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.