Forum Discussion

sherishamarri's avatar
sherishamarri
New Member
2 years ago
Solved

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...
  • Anonymous's avatar
    Anonymous
    2 years ago

    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:

     

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