Forum Discussion
Sort by another column error
Ok, I have the same error happening to another datasource in the same report and this time, I was able to export some sample data to CSV and import it into another Power BI report and was able to recreate the error in this sample Power BI report.
How do I upload the sample files here?
I think I have worked out when this error occurs. With my initial dataset where I was having problems with the ResponseDate field, the reason I stopped having problem with the field after refreshing the dataset was because after refreshing, there were no longer records that are missing ResponseDate values. Whereas in this second dataset, there are many records with missing ClosedDate values because they haven't been closed out yet. I realised this when I attempted the Sort by column on the CreatedDate Month field and realised that I didn't get this error, because every record would have a CreatedDate.
I tested this theory by creating a copy of the sample dataset containing only the Id and the relevant ClosedDate fields, then filtering this dataset to only contain records that have a ClosedDate value. I've discovered that I am now able to sort the Month field by the FinancialMonth. If I then go back into Power Query and removed the step where I filtered the data on the ClosedDate field, the Sort by column on the Month field is still working correctly.
However, when I attempted this workaround in the original sample dataset by applying a non blank filter on the ClosedDate field in Power Query then trying to apply the Sort by column on the Month field in Desktop, I get the same error again 😢
I'm out of ideas again...
Here's the link to the sample PBIX file