Forum Discussion
Sorting Data Manual by other column error
Sort
- Anonymous8 years ago
chotu27,
Would you please share sample data of your table so that I can test?
Regards,
Lydia
4 Replies
- AnonymousNot applicable
chotu27,
As mentioned by the above error message, when you have multiple rows which contain same values for status column(e.g, row1:Active, row2:Active, row3:Active), you should have same sort number(e.g, row1:1,row2:1,row3:1) in Custom Status column.
Regards,
Lydia- chotu27Post Patron
Anonymous Yes exactly but i am sorting the table which other column is there any chnace of getting this done.
- AnonymousNot applicable
We added "sort by" columns to our SQL date/time table - so we can sort the months properly.
Here is the magic SQL we found that sets the "sort by" up correctly for Power BI.
--Month
UPDATE dbo.Time SET Month_Period_Of_Time = RowNumber
FROM dbo.Time TM, (SELECT [Month], ROW_NUMBER() OVER (ORDER BY [Month]) AS RowNumber FROM dbo.Time) AS TMR
WHERE TM.[Month] = TMR.[Month]
UPDATE dbo.Time SET Month_Period_Of_Time_Reverse = RowNumber
FROM dbo.Time TM, (SELECT [Month], ROW_NUMBER() OVER (ORDER BY [Month] DESC) AS RowNumber FROM dbo.Time) AS TMR
WHERE TM.[Month] = TMR.[Month]Each month ends up with the same sort number.