Forum Discussion
Combine or merge Two Table visualization into Single Table visualization in Power BI
- 6 years ago
Hi Mayank08 ,
You need to do the following:
- Create two slicer tables not related with the other tables:
Date Slicer = DISTINCT(Employee[Date]) Report Date Slicer = DISTINCT(Employee[Date])- Create a table with the following setup:
Type of Calculation
Report Date Date This will allow you to make the split on a single table
- Create the following measures:
Leads = SUMX ( sourcemedia; SWITCH ( SELECTEDVALUE ( 'Type'[Type of Calculation] ); "Report Date"; CALCULATE ( COUNT ( Employee[ID] ); FILTER ( ALL ( Employee ); Employee[Date] >= MIN ( 'Report Date Slicer'[Date] ) && Employee[Date] <= MAX ( 'Report Date Slicer'[Date] ) ) ); "Date"; CALCULATE ( COUNT ( Employee[ID] ); FILTER ( ALL ( Employee ); Employee[Date] >= MIN ( 'Date Slicer'[Date] ) && Employee[Date] <= MAX ( 'Date Slicer'[Date] ) ) ) ) ) %MIX = [Leads]/SUMX(SUMMARIZE(ALLSELECTED(sourcemedia);sourcemedia[Name];"@Leads";[Leads]);[@Leads])Now setup a matrix table with the following setup:
- Rows:
- Type of calculation
- Media
- Values:
- Leads
- % Mix
- Disable subtotals on type of calculation level.
If you prefer you can place type of calculation on the colunms.
See attach PBIX file.
Be aware that for some reason your total Leads on the second table was not matching the sum of individual rows In order to solve this I used the SUMX on leads but be aware that you may need to check the data since this can bring performance issues, and believe this is data related. (maybe with the categories that may not match the empployee table)
Hi Mayank08 ,
You need to do the following:
- Create two slicer tables not related with the other tables:
Date Slicer = DISTINCT(Employee[Date])
Report Date Slicer = DISTINCT(Employee[Date])
- Create a table with the following setup:
Type of Calculation
| Report Date |
| Date |
This will allow you to make the split on a single table
- Create the following measures:
Leads =
SUMX (
sourcemedia;
SWITCH (
SELECTEDVALUE ( 'Type'[Type of Calculation] );
"Report Date"; CALCULATE (
COUNT ( Employee[ID] );
FILTER (
ALL ( Employee );
Employee[Date] >= MIN ( 'Report Date Slicer'[Date] )
&& Employee[Date] <= MAX ( 'Report Date Slicer'[Date] )
)
);
"Date"; CALCULATE (
COUNT ( Employee[ID] );
FILTER (
ALL ( Employee );
Employee[Date] >= MIN ( 'Date Slicer'[Date] )
&& Employee[Date] <= MAX ( 'Date Slicer'[Date] )
)
)
)
)
%MIX = [Leads]/SUMX(SUMMARIZE(ALLSELECTED(sourcemedia);sourcemedia[Name];"@Leads";[Leads]);[@Leads])
Now setup a matrix table with the following setup:
- Rows:
- Type of calculation
- Media
- Values:
- Leads
- % Mix
- Disable subtotals on type of calculation level.
If you prefer you can place type of calculation on the colunms.
See attach PBIX file.
Be aware that for some reason your total Leads on the second table was not matching the sum of individual rows In order to solve this I used the SUMX on leads but be aware that you may need to check the data since this can bring performance issues, and believe this is data related. (maybe with the categories that may not match the empployee table)