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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
bhanu_gautam
Super User
Super User

Bringing duplicate data into new table using Power Query

I have two table which contains date column and both of them contains huge data so, is it possible to extract year and month from both the tables and remove duplicate and create a new separate table, right now I am performing append and remove columns action but data is huge so performance is very low using this method , is there any different efficent way to achieve that so that there is no need of appending complete data





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

Proud to be a Super User!




1 ACCEPTED SOLUTION
v-xinruzhu-msft
Community Support
Community Support

Hi @bhanu_gautam 

Make sure the two tables have year and month column, then you can create a blank query, and write the m code in advanced editor, you can refer to the following code.
In this sample, i called the two tables Table1 and Table2

let
    a=Table.SelectColumns(Table1,{"Year","Month"}),
    b=Table.SelectColumns(Table2,{"Year","Month"}),
    c = Table.Combine({a, b}),
    d = Table.Distinct(c)
in
    d

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
bhanu_gautam
Super User
Super User

@v-xinruzhu-msft , Thanks for you help





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

Proud to be a Super User!




v-xinruzhu-msft
Community Support
Community Support

Hi @bhanu_gautam 

Make sure the two tables have year and month column, then you can create a blank query, and write the m code in advanced editor, you can refer to the following code.
In this sample, i called the two tables Table1 and Table2

let
    a=Table.SelectColumns(Table1,{"Year","Month"}),
    b=Table.SelectColumns(Table2,{"Year","Month"}),
    c = Table.Combine({a, b}),
    d = Table.Distinct(c)
in
    d

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

dufoq3
Super User
Super User

Simple answer similar as your question: Yes, it is 🙂


Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

speedramps
Super User
Super User

We want to help you but your description is too vaugue. Please write it again clearly.

Provide small example input data as table text (not a screen print) so we can import the data to build a solution for you.
Remove any unneeded columns which may cause confussion.

Rename columns to user friendly names.
Also provide the example desired output, with a clear description of the process flow.
Remember not to share private data ... we don't want you to get into trouble. 😧
Take time and care to use the same table and field names in the input, output and description so we can understand your problem and help you.
Try keep it simple and ask one question per ticket.
You will get a quick response if you put time, care and effort into writing clear problem descriptions.
Remember you are gerrting free expert help, so please put lots of proper effort to asking questions and providing example.

Vaugue descriptions can waste your time and ourtime.

Look foward to helping you when the above information is forthcoming

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.

Top Solution Authors
Top Kudoed Authors