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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply

How to Append Tables Based on a Condition

Hi there:

 

I have 2 tables containing participants for multiple events that we have hosted.  One table contains specific session by session attendance by individual ONLY for events that have multiple sessions.  The other table contains overarching event individual attendance across all events that were hosted (i.e. it includes BOTH events that are a single session AND those that are multiple sessions, but it does not break down which sessions an individual attended).  Overall, I want all of the attendance information combined into one table, so I would imagine that I need to append these 2 tables together.  HOWEVER, the 2nd table includes attendance across all events, and I only want to add the attendance to the single session events from the second table to the attendance for multiple session events in the first table.  How can I append them so it includes everything from the first table and only a subset of information from the second table? 

1 ACCEPTED SOLUTION

I have performed one Right Anti join. This join removed the matching rows from second table.

Removed all columns and expanded the table.

Now, I have a table which is having common rows removed from second table.

Appended this result to Output of Changed Type which was our original table.

Replace null in Session with Single-session.

View solution in original post

9 REPLIES 9
Vijay_A_Verma
Super User
Super User

Can you please both table structures alongwith some sample data?

Hi there:

 

I cannot provide real data, but here is a basic mock-up of what the two tables would look like.  And what I would want to do.  I only need the stuff in green from Table 2 added to Table 1 (and exclude from appending the cells in grey).

christhompson_0-1649696643174.png

 

So how can I get the data from Table 2 in green to be in Table 1?

Can you explain the steps of what you did?  I'm trying to learn what you did so I can apply it to the real data scenario I am dealing with.

I have performed one Right Anti join. This join removed the matching rows from second table.

Removed all columns and expanded the table.

Now, I have a table which is having common rows removed from second table.

Appended this result to Output of Changed Type which was our original table.

Replace null in Session with Single-session.

Vijay_A_Verma
Super User
Super User

Description of problem statement is missing.

How to Get your Question Answered Quickly - https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

I just updated it

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! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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