Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Kristofferaabo
Helper IV
Helper IV

Summarize table

HI,

 

I would like to create a simple table based on another table, it must pull following columns where "Column A" should be uniques (like an excel pivot table)

 

Column A (unique values)

Colunm B (Can be first)

Column C (Can be first)

Column D (Can b first)

 

The purpose is to use this as a master table and thereby link other tables to its unique column A values

 

Thanks

Kristoffer

 

 

1 ACCEPTED SOLUTION

Hi Kristofferaabo,

 

To create a new table, in dax, you can use summarize(), selectcolumns(), addcolumns().

To achieve distinct values in column A oin the calculate table, you can use summarize function like pattern below:

calculate table =
UNION (
    SUMMARIZE (
        old_table1,
        old_table1[column_need_to_be_distinct],
        "column1", SUM ( old_table1[column1] )
    ),
    SUMMARIZE (
        old_table2,
        old_table2[column_need_to_de_distinct],
        "column2", SUM ( old_table2[column2] )
    )
)

Also refer to DAX summarize here:https://msdn.microsoft.com/en-us/query-bi/dax/summarize-function-dax

 

Regards,

Jimmy Tao

View solution in original post

5 REPLIES 5
v-yuta-msft
Community Support
Community Support

Hi Kristofferaabo,

 

So you want to duplicate values in column A, right? You can refer to this case:

https://community.powerbi.com/t5/Desktop/How-can-I-remove-duplicate-values-from-a-single-column-with...

 

Regards,

Jimmy Tao

Hi @v-yuta-msft

Thanks for your reply. No I'm nor interested to have duplicates in my new column (column A).

This new table must only return distinct values from the other table

Thanks

Kristoffer

 

 

Hi Kristofferaabo,

 

To create a new table, in dax, you can use summarize(), selectcolumns(), addcolumns().

To achieve distinct values in column A oin the calculate table, you can use summarize function like pattern below:

calculate table =
UNION (
    SUMMARIZE (
        old_table1,
        old_table1[column_need_to_be_distinct],
        "column1", SUM ( old_table1[column1] )
    ),
    SUMMARIZE (
        old_table2,
        old_table2[column_need_to_de_distinct],
        "column2", SUM ( old_table2[column2] )
    )
)

Also refer to DAX summarize here:https://msdn.microsoft.com/en-us/query-bi/dax/summarize-function-dax

 

Regards,

Jimmy Tao

MattAllington
Community Champion
Community Champion

Why not do this with groupby in Power Query



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

 

Hi @MattAllington

Thats looks interesting, can Column A be unique still?

How would this look?

 

Thanks

K

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.