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
satishkurra
Frequent Visitor

Generate UniqueID column based on 2 existing columns

Hi

 

Below is the snapshot of sample data. I need to generate distinct/unique ID column (this will be a new column in the same table) based on the 2 columns storeID and productID.

 

I'm trying to do this in power query edit mode.

 

Request to please help on the same.

 

Thanks

UniqueID.png

6 REPLIES 6
Anonymous
Not applicable

Hi @satishkurra 

What is the expected results?
Can you provide some examples?

Ta

Thanks for responding.

 

Expected output attachedOutput.png

Anonymous
Not applicable

So,

It is a random number?

How about adding an index column?
https://youtu.be/hhZ04by1UuQ

 

 

Index will add unique record for all rows.

 

I need unique id column based on unique values from both storeid and productid

Anonymous
Not applicable

Sorry,

But according to your example these are just random numbers.

Provide more sample data so we can better understand the expected outcome.

 

Hi

 

These are not just random numbers. It created unique id for Key field 1,2,3,4 for unique combination of Storeid and productid.

 

Here is the sample data. 

 

 StoreID ProductID
11
12
11
12
21
22
21

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.