Forum Discussion

palvarez83's avatar
palvarez83
Helper I
7 years ago

Create sort column with duplicates based on another column

 

Hello,

I have the dimension table dPAU  pictured below that was created with Power Query.  In Power query I sorted the PAU based on the dates on the second column and created an index column dPAU[Sort] that I can use to sort the dPAU[PAU].

 

I would like sort the dPAU[Module column], based on another column, but there are duplicates.  In the larger data set, these duplicates can have differenent dates associated with them.  My instinct is to create a calculated column  that ranks each module based on the earliest date.  If a module has duplicates it should use the earliest of the dates for its ranking and would return the same rank for each set of duplicates.  Not sure where to start or which DAX functions to use.   Any help would be appreciated.

 

Thank you,

 

3 Replies

    • palvarez83's avatar
      palvarez83
      Helper I

      Anonymous wrote:

      Hi palvarez83 ,

      You can take a look at following blog to know how to create a sorting table to achieve your requirement:

      Custom Sorting in Power BI

      Regard,

      Xiaoxin Sheng



      Anonymous wrote:

      Hi palvarez83 ,

      You can take a look at following blog to know how to create a sorting table to achieve your requirement:

      Custom Sorting in Power BI

      Regard,

      Xiaoxin Sheng


      Hi,

      Yes, I can do it with Power Query index column.  That's what I did for the PAU.... but for the Module I have duplicates and would like to do it with DAX in the data model.

      • Anonymous's avatar
        Anonymous
        Not applicable

        HI palvarez83 ,

        If you can please share a pbix file with some sample data and expected result for test.

        Notice: do mask on sensitive data before share.

        Regards,

        Xiaoxin Sheng