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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
MEHUL123
Frequent Visitor

To bring Distinct value in separate table in power query

Hi,

 

I have 4 tables in powerbi.

Each table contains "ORDER ID" data colunm (But Order ID data colunm is having different  title in all 4 table)

I need to create separate table in which distinct ORDER IDs to be shown in single colunm. Pls help with M code in powerbi query editor (not DAX)

 

Pls help,

Thanks in advance.

1 ACCEPTED SOLUTION
xifeng_L
Super User
Super User

Hi @MEHUL123 ,

 

You can try below Query:

 

let
    Source = 
        Table.FromColumns(
            {
                List.Distinct(
                    List.Combine(
                        {
                            Table1[OrderIdName1],
                            Table2[OrderIdName2],
                            Table3[OrderIdName3],
                            ...
                        }
                    )
                )
            },
            {"ORDER ID"}
        )
in
    Source

 

Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !

 

Thank you~

 

 

View solution in original post

1 REPLY 1
xifeng_L
Super User
Super User

Hi @MEHUL123 ,

 

You can try below Query:

 

let
    Source = 
        Table.FromColumns(
            {
                List.Distinct(
                    List.Combine(
                        {
                            Table1[OrderIdName1],
                            Table2[OrderIdName2],
                            Table3[OrderIdName3],
                            ...
                        }
                    )
                )
            },
            {"ORDER ID"}
        )
in
    Source

 

Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !

 

Thank you~

 

 

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 MSCUST for a $150 discount!

November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.