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
Anonymous
Not applicable

Serial Number for union table duplicates

Hello Folks,
How are you guys ? Im able to generate the column "Stop" for the table as shown below 

UniqueidBLMStopStoreDate of plan
AA1s1AA11s109/21/2020 10:00
AA1s2AA12s209/22/2020 11:00
AA1s2AA12s209/22/2020 11:00


with the followiung dax 

Stop = (
                RANKX(
                     FILTER(Table1,Table1[BLM] = EARLIER(Table1[BLM]),
                        Table1[Date of Planl],,ASC,Dense))

Im aware that 3rd record is a duplicate of row 2 but i want a new number to be assigned by "DAX" ( no power query please since it is a union table) as below 

UniqueidBLMStopStoreDate of plan
AA1s1AA11s109/21/2020 10:00
AA1s2AA12s209/22/2020 11:00
AA1s2AA13s209/22/2020 11:00


Ive tried both dense and skip option in rankx

Thanks for your help in advance

 

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@Anonymous 

You need to add a helper column to your table like:

RankSupport = [Date of plan] + RAND()

 

Then add the STOP column with this code:

Stop = 
RANKX(
    FILTER(Table5,Table5[BLM] = EARLIER(Table5[BLM])),
    Table5[RankSupport],,ASC,Dense
)

Fowmy_0-1600980541458.png

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

 






Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

4 REPLIES 4
Fowmy
Super User
Super User

@Anonymous 

You need to add a helper column to your table like:

RankSupport = [Date of plan] + RAND()

 

Then add the STOP column with this code:

Stop = 
RANKX(
    FILTER(Table5,Table5[BLM] = EARLIER(Table5[BLM])),
    Table5[RankSupport],,ASC,Dense
)

Fowmy_0-1600980541458.png

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

 






Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

Thanks a lot it worked 🙂

 

TomMartens
Super User
Super User

Hey @Anonymous ,

 

I used this DAX statement for a calculated column:

Column = RANKX(
    ALL('Table'[Uniqueid] , 'Table'[BLM] , 'Table'[Store] , 'Table'[Date of plan])
    , CALCULATE(MAX('Table'[Date of plan]))
    ,
    , ASC
)

The result will look like this:

TomMartens_0-1600974376399.png

Hopefully, this is what you are looking for.

 

Regards,
Tom

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Anonymous
Not applicable

Hi @TomMartens  im super sorry ...the date in row 2 and row 3 has to be the same i changed it now.. Also i tired your approach and it throws error "circular dependency" is detected 

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.