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
Mayank08
Frequent Visitor

Combine or merge Two Table visualization into Single Table visualization in Power BI

I have one Dashboard File in power BI.

 

Inside one report is there with name Employee.

 

Employee report has Two (2) Date slicer and Two (2) separate Table visualization. 1 Date slicer filter only one table and another date slicer filters another table separately using Edit Interaction. (Both Date slicer and both table are same I just make it Duplicate of each. Using edit Interaction one date filter only one table. I chossed both slicer with different dates and data is perfactly filtering  and showing different value.)

 

Now I want to combine both table into single table. How to combine both table into single table?

 

I am sharing below Power BI URL link to download the power BI file. 

 

https://drive.google.com/open?id=1sCmmT7AvxMgCBq95LSceIvd17rjmNhbA

 

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

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)

https://we.tl/t-chOClFVYbm

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

3 REPLIES 3
MayYu
Frequent Visitor

I'm having the same problem, but I using live connection, so no DAX nor power query allowed. Column A is for states, Column B is for item name, now each row with the same state and item name are duplicate each other, which looks very messy. Is there any solution that for the same state and same item name can be merged, like Excel merge function. Live connect has a lot limitation, I cannot using any power query/DAX now. Thanks!

amitchandak
Super User
Super User

@Mayank08 Does the above reply helps. if you need more help make me @

Appreciate your Kudos.

MFelix
Super User
Super User

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)

https://we.tl/t-chOClFVYbm

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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