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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.