Forum Discussion
Power BI Not Sorting column
- 8 months ago
yashwant101,
Here's what you can do:
1. Change the data type of column to whole number. Text will also sort it but based on ASCII ordering
2. Easiest, Quickest, Safest for long-term model development: Create a separate time period sort order table with just these 2 columns, make sure sort order column is whole number. Create a relationship between any table's time period to this table's time period and use this table in visuals. Filtering for the relationship would be uni-directional from sort order table to any other table with it.
Give a Thumbs Up if this post helped you in any way and Mark This Post as Solution if it solved your query !!!
Proud To Be a Super User !!!
LinkedIn
Hi,
It sounds like Power BI finds more than one possible 'Time Period Sort' value for a single value in the column being sorted and it throws the error.
Under DAX Query view you can write a simple query to check if this happened
EVALUATE
FILTER(
SUMMARIZE(
'table',
'table'[Time Period],
"DistinctSortCount", DISTINCTCOUNT('table'[Time Period Sort])
),
[DistinctSortCount] > 1
)
ORDER BY [Time Period]
- yashwant1018 months agoHelper III
Hi MasonMA ,
thanks for the quick response, but running the query gives me no result - meaning I have unique values only.
- MasonMA8 months agoSuper User
Can you share this part of data in a .pbix file? I tested on my Power BI with only the sample data from your screenshot and im not seeing the issues you ran into.