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
Kristofferaabo
Helper IV
Helper IV

mastertable based on groupby or summarize

Hi,

 

I want to create a new table (Table A) based on colulms from another table (Table B).

 

In my table A I want only unique/distict values from Column A in Table B to be returned, like a pivot in excel.

 

How can I do that, I have tried with groupby and summarize, but now luck..

 

Thanks
Kristoffer

1 ACCEPTED SOLUTION

Hi @Kristofferaabo

 

Both should provide unique values.  I wonder if you have leading, or trailing spaces that need to be cleaned using TRIM 

 

eg, if I have Table B with the following data

 

Country

----------

A

A

A

B

B

 

The output of the DAX I gave you should be

 

Country

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

A

B

 

I have attached a PBIX file

 

 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

4 REPLIES 4
Phil_Seamark
Employee
Employee

Hi @Kristofferaabo

 

You can create a calculated table using the following syntax

 

New Table = ALL('Table B'[Column A])

Or

 

New Table = SUMMARIZECOLUMNS('Table B'[Column A])

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Hi @Phil_SeamarkI think I have tried this, but it wont return unique values.. For instance I column A was a country column, I only want United States to be returned once.

 

 

Do I do something wrong?

Hi @Kristofferaabo

 

Both should provide unique values.  I wonder if you have leading, or trailing spaces that need to be cleaned using TRIM 

 

eg, if I have Table B with the following data

 

Country

----------

A

A

A

B

B

 

The output of the DAX I gave you should be

 

Country

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

A

B

 

I have attached a PBIX file

 

 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Hi all,

i have seen your discussion and i have a similar situation but with one step further

on main table i have also a column like Sales; and i want to obtain a new table like yours, with unique values, but also with sum of Sales for each

is it posible?

Thanks,

Cosmin

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.