Forum Discussion

alexa_0028's avatar
alexa_0028
Resolver II
4 years ago
Solved

What is the sorting algorithm used by PBI?

Hi All, I want to know the sorting algorithm of PBI. In Redshift DB when I sort a column(it sorts on ascii value), but I don't see the same sorting results on the PBI visuals because my data is a...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi alexa_0028 ,

     

    As far as I know, Power BI will sort your data based on data format. As normal, Power BI will sort the numbers according to their size or dates according to chronological order.

    If you have multiple different data in one cell like number, text, and delimiters. For example: 1,10,ACE

    The data type of this columns is text. Power BI will sort this column by each value in same position in cells.

    For example there is a column with two rows. 

    row1: 1,10,ACE

    row2: ACE,10

    This column is in text format. Power BI will sort row1 and row2 by first value in them. 1<A so Power BI will use this sort to sort the column. If the first data in row1 and row2 are both 1. Power BI will compare the second value in them until get the result.

    From my test, I know sort is delimiters<number<text. And delimiters/numbers/text still contain the normal logic in them. Like 1<2<3... A<B<C...

     

    Best Regards,
    Rico Zhou

     

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