Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

How to sort the column?

Hi!

 

I have a column, text type as follows:

 

before 200001

200001

200002

200003

200004

......

202210

 

Please help me how to sort them so that before 200001 is on the first place. Thank you!

2 ACCEPTED SOLUTIONS
mangaus1111
Solution Sage
Solution Sage

Hi @Anonymous ,

 

insert in your data model a sort table like this and make a relatiosnship between the 2 columns

mangaus1111_0-1666620157901.png

Don´t forget to sort the Column Text in the Sort Table by the Index Column.

 

mangaus1111_1-1666620268168.png

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

Hi @Anonymous ,

 

see my pbi file here. I hope this helps

https://1drv.ms/u/s!Aj45jbu0mDVJiHfRIaja1FReNxxK?e=C08XII

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

8 REPLIES 8
Anonymous
Not applicable

Thank you! But it always says a circular dependancy was detected. Before 20000101, 20000101.... is a calculated column not imported from.

You need a data model with 2 tables realted 1 to many: Sort Table as Dimension and Fact Table.

You need to import the Sort Table

 

mangaus1111_0-1666701417455.png

 

Anonymous
Not applicable

Because this text column is not imported but a calculated column, I can not insert an index column using power query.  What I did is new column=if (text="before 20000101", "20000100", text), and then I use this column to sort the text column. However when I sort it, it can not work and shows "circular dependancy."

Hi @Anonymous ,

 

see my pbi file here. I hope this helps

https://1drv.ms/u/s!Aj45jbu0mDVJiHfRIaja1FReNxxK?e=C08XII

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

@mangaus1111 Thank you! May I ask you how to insert index and how to make "before 20000101" as index 1? Also the last number is "Now"

before 200001

200001

200002

200003

200004

......

202210
Now

you can easily import in power query  table like this

mangaus1111_0-1666676458831.png

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

mangaus1111
Solution Sage
Solution Sage

Use the column SortTable[Text] in the row of your visual, otherwise it does not work.

mangaus1111
Solution Sage
Solution Sage

Hi @Anonymous ,

 

insert in your data model a sort table like this and make a relatiosnship between the 2 columns

mangaus1111_0-1666620157901.png

Don´t forget to sort the Column Text in the Sort Table by the Index Column.

 

mangaus1111_1-1666620268168.png

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors