Forum Discussion

Mayank08's avatar
Mayank08
Frequent Visitor
6 years ago
Solved

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

 

  • 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

     

     

3 Replies

  • 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

     

     

  • MayYu's avatar
    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!