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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
sherishamarri
New Member

Merge queries to get everything in one table

Hello All,

 

I'm new to pwerbi and I have requirememt where we need to get data forn 3 different tables in to one table.

I have tried with merge queries and DAX formulas but the result is not that i expected, It is returning rows from all tables getting duplicate values.

And also there is a condition that for expense category F&B should be divided in to all attendees and speaker who ever attended the program EX:( for program 1 if attendee count is 3 and F&B is 300$ it should divide the amount to 100$ for each attendee and speaker but for category ffs only speaker data should reurn as ffs will only applies to speaker)

Sometimes for cancelled program no attendees will be there so I'm adding another table "Speaker" to get the amount of speakers ffs.

I have atteched the Expected Result Table for your reference.

I'm missing something easy may be but struck here form last 4 days.

Any help highly appreciated.

 

 

sherishamarri_0-1709837789195.png

 

 

 

 

sherishamarri_1-1709837826886.png

sherishamarri_2-1709837865520.png

 

sherishamarri_3-1709837911747.png

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @sherishamarri 

 

You can follow below steps to get what you want. 

 

1. Rename columns in "Speaker" table to make them the same as those in "Attendee". 

2. Append "Speaker" table to "Attendee". Append queries - Power Query

3. Merge "Attendee" to "Expense" by "Pgm Name" column with left outer. 

4. Add three custom columns one by one:

Modified Attendee:

if [Category] = "FFS" then Table.SelectRows([Attendee], each [Type] = "Speaker") else [Attendee]

Count:

Table.RowCount([Modified Attendee])

New Amount:

[Amount]/[Count]

5. Expand the first custom column and only select the columns you need to expand. 

6. Remove unnecessay columns and rename columns. 

 

The final expense table:

vjingzhanmsft_0-1709891144930.png

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @sherishamarri 

 

You can follow below steps to get what you want. 

 

1. Rename columns in "Speaker" table to make them the same as those in "Attendee". 

2. Append "Speaker" table to "Attendee". Append queries - Power Query

3. Merge "Attendee" to "Expense" by "Pgm Name" column with left outer. 

4. Add three custom columns one by one:

Modified Attendee:

if [Category] = "FFS" then Table.SelectRows([Attendee], each [Type] = "Speaker") else [Attendee]

Count:

Table.RowCount([Modified Attendee])

New Amount:

[Amount]/[Count]

5. Expand the first custom column and only select the columns you need to expand. 

6. Remove unnecessay columns and rename columns. 

 

The final expense table:

vjingzhanmsft_0-1709891144930.png

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

Thank you so much, this helped alot!!!!

lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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