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
bgashok
Helper I
Helper I

Combine four table columns in report table

I have four table with same coloumns names and have direct parent child relations across in model.  I want to create a report table with two columns showing all 4 tables. how can this be possible. 

1 ACCEPTED SOLUTION

Hi @bgashok ,

 

According to your statement, I think you want to combine four tables which has same columns with different data into one.

As far as I know, you can try Append function  in Power Query Editor should be a good choice. If the filter don't work, please make sure the relationship between your tables. Power BI doesn't support there to be two active relationship between two tables.

Or you can create a Dimtable with all Key values in your four tables and then relate it with four tables.

My Sample:

DimKey = 
UNION(VALUES('Table 1'[Key Column]),VALUES('Table 2'[Key Column]),VALUES('Table 3'[Key Column]),VALUES('Table 4'[Key Column]))

vrzhoumsft_0-1692779553449.png

Measure = 
SWITCH (
    TRUE (),
    MAX ( DimKey[Key Column] ) IN VALUES ( 'Table 1'[Key Column] ), CALCULATE(SUM ( 'Table 1'[Value] ),USERELATIONSHIP('Table 1'[Date],DimDate[Date])),
    MAX ( DimKey[Key Column] ) IN VALUES ( 'Table 2'[Key Column] ), CALCULATE(SUM ( 'Table 2'[Value] ),USERELATIONSHIP('Table 2'[Date],DimDate[Date])),
    MAX ( DimKey[Key Column] ) IN VALUES ( 'Table 3'[Key Column] ), CALCULATE(SUM ( 'Table 3'[Value] ),USERELATIONSHIP('Table 3'[Date],DimDate[Date])),
    MAX ( DimKey[Key Column] ) IN VALUES ( 'Table 4'[Key Column] ), CALCULATE(SUM ( 'Table 4'[Value] ),USERELATIONSHIP('Table 4'[Date],DimDate[Date]))
)

Result is as below.

vrzhoumsft_1-1692779611795.png

Best Regards,
Rico Zhou

 

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

5 REPLIES 5
Idrissshatila
Super User
Super User

Hello @bgashok ,

 

I think you mean merge queries, check it out https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-shape-and-combine-data

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Follow me on Linkedin
Vote For my Idea💡

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Hi, 

I have 4 tables (users story, feature,EPIC) with information id, title and parent id.  Parent id and Id of tables are related in model. Like user story parent ID is in relationship with feature ID.

I am trying to create a table in REPORT tab showing ID and title of 4 tables together, so that with filter I can show required data.

Hello @bgashok ,

 

so you create a dimension table with these common columns and you link it to all four tables and filter by these fields in the new table.

check this out https://zebrabi.com/advanced-guide/how-to-create-fact-and-dimension-tables-in-power-bi/

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Follow me on Linkedin
Vote For my Idea💡

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Hi @Idrissshatila ,

 

I created append table with all four but the filters as per parent linking was not working. I am look of creating table in REPORT but not a new table in Tables. As I would be happy expanding the solution to next level once th tabel in report works.

Hi @bgashok ,

 

According to your statement, I think you want to combine four tables which has same columns with different data into one.

As far as I know, you can try Append function  in Power Query Editor should be a good choice. If the filter don't work, please make sure the relationship between your tables. Power BI doesn't support there to be two active relationship between two tables.

Or you can create a Dimtable with all Key values in your four tables and then relate it with four tables.

My Sample:

DimKey = 
UNION(VALUES('Table 1'[Key Column]),VALUES('Table 2'[Key Column]),VALUES('Table 3'[Key Column]),VALUES('Table 4'[Key Column]))

vrzhoumsft_0-1692779553449.png

Measure = 
SWITCH (
    TRUE (),
    MAX ( DimKey[Key Column] ) IN VALUES ( 'Table 1'[Key Column] ), CALCULATE(SUM ( 'Table 1'[Value] ),USERELATIONSHIP('Table 1'[Date],DimDate[Date])),
    MAX ( DimKey[Key Column] ) IN VALUES ( 'Table 2'[Key Column] ), CALCULATE(SUM ( 'Table 2'[Value] ),USERELATIONSHIP('Table 2'[Date],DimDate[Date])),
    MAX ( DimKey[Key Column] ) IN VALUES ( 'Table 3'[Key Column] ), CALCULATE(SUM ( 'Table 3'[Value] ),USERELATIONSHIP('Table 3'[Date],DimDate[Date])),
    MAX ( DimKey[Key Column] ) IN VALUES ( 'Table 4'[Key Column] ), CALCULATE(SUM ( 'Table 4'[Value] ),USERELATIONSHIP('Table 4'[Date],DimDate[Date]))
)

Result is as below.

vrzhoumsft_1-1692779611795.png

Best Regards,
Rico Zhou

 

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

 

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.