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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
MacJasem
Helper III
Helper III

How do you create a unique row value combination ID to a table?

Hi Guys

 

You never fail to help out with a powerbi "puzzle" 😄

 

I've got a dimension table with the following columns:

 

Dimension_IDDepartmentBusiness areaFunctionTypeUnique_ID
1Adminitrationnullnullnull?
1Airnullnullnull?
1nullSeanullnull?
1nullnullImportnull?
1nullnullnullForwarding?
1Air/Sea/Railnullnullnull?
1nullnullDomesticnull?
2Seanullnullnull?
2Railnullnullnull?
2Continentnullnullnull?
2nullContinent Roadnullnull?
2nullnullExportnull?
2nullnullnullForwarding?
2nullnullDomesticnull?

 

As you can see the dimension id's i get are the same for different combination of row values. 

 

what  i want is to create a unique_id column that gives a unique id to every row combination that is unique.

Next question is, the Dimension ID is the relation to the fact table. I can't remove duplicates in that column then i'll loose a lot of row value combinations that i need, and if i create this Unique_ID column i'd want it to become the relationship tie between the dimension and fact table, but not sure that is possible. 

Any idea how i can untangle this dilemma?

1 ACCEPTED SOLUTION
v-cgao-msft
Community Support
Community Support

Hi @MacJasem ,

See if these two columns meet the requirements:

Unique_ID 1 = CONCATENATE(CONCATENATE(CONCATENATE(CONCATENATE([Dimension_ID], [Department]), [Business area]), [Function]), [Type])
Unique_ID 2 = RANKX(ALL('Table'), CONCATENATE(CONCATENATE(CONCATENATE(CONCATENATE([Dimension_ID], [Department]), [Business area]), [Function]), [Type]), , , Dense)

Output:

vcgaomsft_0-1693364509015.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

1 REPLY 1
v-cgao-msft
Community Support
Community Support

Hi @MacJasem ,

See if these two columns meet the requirements:

Unique_ID 1 = CONCATENATE(CONCATENATE(CONCATENATE(CONCATENATE([Dimension_ID], [Department]), [Business area]), [Function]), [Type])
Unique_ID 2 = RANKX(ALL('Table'), CONCATENATE(CONCATENATE(CONCATENATE(CONCATENATE([Dimension_ID], [Department]), [Business area]), [Function]), [Type]), , , Dense)

Output:

vcgaomsft_0-1693364509015.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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