Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
palvarez83
Helper I
Helper I

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,

Capture.PNG

 

3 REPLIES 3
v-shex-msft
Community Support
Community Support

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.


@v-shex-msft 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



@v-shex-msft 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.

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.