cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bclrk Frequent Visitor
Frequent Visitor

Id based on multiple columns

Hello,

 

I need an id based on three different columns with text. Right now the way that I am doing this is by concatenating all three columns together using the DAX below and it is working fine.

factorid = factors[desk] & ":" & factors[name] & ": " & factors[factor]

However, I am new to Power BI and this doesn't feel optimal. Is there a command that could give me a unique integer based on the value in three different columns? Some kind of hash maybe?

 

Thank you

5 REPLIES 5
kentyler Member
Member

Re: Id based on multiple columns

Can you tell us why you need the unique id.

kentyler Member
Member

Re: Id based on multiple columns

The other idea that comes up is that this is usually done before loading the data into power bi, if you can access the data file and operated on it, maybe in excel, access or sql server

Community Support Team
Community Support Team

Re: Id based on multiple columns

@bclrk ,

 

Maybe something like below?

factorid =
VAR _1 = factors[deskcode]
VAR _2 = factors[model_name]
VAR _3 = factors[factor]
RETURN
    CONCATENATE ( _1, CONCATENATE ( _2, _3 ) )

Regards,

Jimmy Tao

bclrk Frequent Visitor
Frequent Visitor

Re: Id based on multiple columns

I want to have three filters, f1, f2, and f3, such that f1 filters f2 and f3, f2 filters f3 and all of them filter data from two different data tables.

 

In order to get these filters to work, I created a new table that has a one to many relationship with the two data tables via the factorid.

bclrk Frequent Visitor
Frequent Visitor

Re: Id based on multiple columns

I don't think that would work because there are different values in a single column that need to be distinguished. 

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

New Badges

Incoming: New and Improved Badges

Exciting news: We've given our badges an overhaul and added brand news ones.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 277 members 2,734 guests
Please welcome our newest community members: