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
ArchStanton
Post Prodigy
Post Prodigy

Sort not working

Hi,

 

I've ranked these 1-9 in a different column but I cant get it to sort from 0-3mth, 3-6mths and so on because of a Circular dependency

 

ArchStanton_0-1669827241113.png

 

ArchStanton_1-1669827297911.png

What am I doing wrong?

Thanks

 

1 ACCEPTED SOLUTION
Mikelytics
Resident Rockstar
Resident Rockstar

Hi @ArchStanton 

 

You could create a manual table where you maintain the items in a distinct list with an additional column where you define the order of the items. I call it the sorting ID. 

 

You can bring in the data of the new table by connecting it to your data kodel or by applying a join/merge on the real table with the Age Profile.

 

Afterwards you should have besides to the Age Prodil also your sort ID in one table. Then you can use the sort by column feature where you sort one column by the order of another one. Please find below an example for a date table where I sort the month name by the month number:

Mikelytics_0-1669908193481.png

the natural sorting of my monthname but be wrong. But thanks to the sort by column feature when I use the Month Name in a report it sorts it correctly.

Mikelytics_1-1669908260962.png

 

So to make a long story short please make sure that you have next to your AgeProfile Column another numeric column which gives the order of this column. Then use the sort by column feature and you should be good to go.

 

Best regards

Michael

-----------------------------------------------------

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

@ me in replies or I'll lose your thread.

-----------------------------------------------------

LinkedIn

 

 

 

 

 

 

 

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!

View solution in original post

5 REPLIES 5
Mikelytics
Resident Rockstar
Resident Rockstar

Hi @ArchStanton 

 

You could create a manual table where you maintain the items in a distinct list with an additional column where you define the order of the items. I call it the sorting ID. 

 

You can bring in the data of the new table by connecting it to your data kodel or by applying a join/merge on the real table with the Age Profile.

 

Afterwards you should have besides to the Age Prodil also your sort ID in one table. Then you can use the sort by column feature where you sort one column by the order of another one. Please find below an example for a date table where I sort the month name by the month number:

Mikelytics_0-1669908193481.png

the natural sorting of my monthname but be wrong. But thanks to the sort by column feature when I use the Month Name in a report it sorts it correctly.

Mikelytics_1-1669908260962.png

 

So to make a long story short please make sure that you have next to your AgeProfile Column another numeric column which gives the order of this column. Then use the sort by column feature and you should be good to go.

 

Best regards

Michael

-----------------------------------------------------

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

@ me in replies or I'll lose your thread.

-----------------------------------------------------

LinkedIn

 

 

 

 

 

 

 

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!

Thanks for this. 

My DAX knowledge is still limited but I managed to use parts of your advice to fix the problem.

I created a simple excel table with 1-9 Rank and the corresponding date bands (0-3, 3-6 etc)

 

I added this to the model and joined the tables on the rank column, which I then used to sort the date bands in the table. I swapped these date bands for the old ones and it fixed the problem!

 

ArchStanton_0-1669910095347.png

 

I'm sure there's a quicker way to do this but I don't care! Thank you for helping me, I was well and truly stuck until you intervened 👍

 

 

Hi @ArchStanton 

 

Thakn you for your feedback. Can you please mark it as solution to make it better finable for others? I appreciate your thumbs up.

 

Best regards

Michael

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!
amitchandak
Super User
Super User

@ArchStanton , You need to so like

 

New column = [Column]

Column Sort = <Sort logic or Rank>

 

Now sort New column on Column sort and use that in visual

 

How to Create Sort Column and Solve Related Errors:
https://www.youtube.com/watch?v=KK1zu4MBb-c

Sorry I don't understand a word of what you are saying.

 

I have over 25,000 rows of data so what new column am I supposed to create and what should it be based on?

 

I watched your video and from what I can see I cannot apply that logic because my data table is a lot more complicated

 

Also, my date are on the Rows not Columns:

 

ArchStanton_0-1669906302149.png

 

Thanks

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.