cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver I
Resolver I

create new table with partial columns from another table in dax

Hi

I wonder if there is a way to create a table in dax that is the same like another table but with less colmun.

for example :

table "A" has "col1","col2","col3"

I want to create table "B" with just "col1","col2"

 

thanks

13 REPLIES 13
Highlighted

@Greg_Deckler I usually follow this steps; try not to bother with dax regarding minor stuffs; like duplicate table, drop the unnecessary column, if required, remove duplicates, then if required, add the relationship manually. Yet just wanted to refresh my memory with dax expressions... Smiley Very Happy

Highlighted

Try using SUMMARIZECOLUMNS ... 

Highlighted

I think selectcolumns() is what you are looking for:

 

https://msdn.microsoft.com/en-us/library/mt761759.aspx

Advocate I
Advocate I

 I am not a pro power bi user. I think I find out an easy way to solve your problem if we are facing the same problem. 

TABLE B = 

SELECTCOLUMNS(CALCULATETABLE( TABLEA,FILTER(TABLEA,TABLEA[col1]=x)),"col1",'TABLEA'[col1],"col2",TABLEA[col2])
 
Consider the duplicate rows, you can wrap a "DISTINCT" on the formula as below"
 

TABLE B = 

DISTINCT(SELECTCOLUMNS(CALCULATETABLE( TABLEA,FILTER(TABLEA,TABLEA[col1]=x)),"col1",'TABLEA'[col1],"col2",TABLEA[col2]))
 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors