cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Patron
Post Patron

create a new table with distinct values of one column, and the value of one other column

Hi,

 

I am struggling to achieve something which seems quite simple!

 

I want to create a new table using DAX with distinct values of one column, and the value of one other column - in the original table there are multiple entries, but each has two different references which are the same of each row.  See below example:

 

Original table

 

Ref1  Ref2  Amount

CDD  ROO    34

CDD  ROO    567

ABB  TEE        467

ABB  TEE        45

 

New Table

 

Ref1  Ref2

CDD  ROO

ABB  TEE

 

I can create the first column just using DISTINCT, but can't seem to return the other value.  I tried LOOKUPVALUE but it returned blanks!

 

Any help greatly appreciated.

 

Thanks

 

David

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User IV
Super User IV

Re: create a new table with distinct values of one column, and the value of one other column

Table = DISTINCT(SELECTCOLUMNS('Table',"Ref1",[Ref1],"Ref2",[Ref2]))


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Highlighted
Solution Specialist
Solution Specialist

Re: create a new table with distinct values of one column, and the value of one other column

Hi @DavidWaters100 ,

see figure:

 

25-04-_2020_17-09-52.pngRegards FrankAT

View solution in original post

3 REPLIES 3
Highlighted
Super User IV
Super User IV

Re: create a new table with distinct values of one column, and the value of one other column

Table = DISTINCT(SELECTCOLUMNS('Table',"Ref1",[Ref1],"Ref2",[Ref2]))


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Highlighted
Solution Specialist
Solution Specialist

Re: create a new table with distinct values of one column, and the value of one other column

Hi @DavidWaters100 ,

see figure:

 

25-04-_2020_17-09-52.pngRegards FrankAT

View solution in original post

Highlighted
Post Patron
Post Patron

Re: create a new table with distinct values of one column, and the value of one other column

Thank you very much - both answers I have accepted as solutions!

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Galleries

Galleries

Looking for inspiration on how to present your data? Need instructional videos? Check out our Galleries!

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors