Forum Discussion

SantoshKumar's avatar
SantoshKumar
Microsoft Employee
6 years ago
Solved

How to create a relationship between two mutually exclusive tables to show count as per month wise

Hi,

I have Two tables which have same structure but does not contains same data at all.
i am trying to show the count of items as per Month, quater and year wise.

i used scorecard with the use of Measures for calculating count .
when i select any month or year, data reflecting only from one table. i undertood that its the issue due to relationship between the two table but i have tried all relationship available but none of them gave the expected result.
Could anyone help me to solve this issue.

 

Thanks

Santosh Kumar P

  • Hi,

    I have got the answer for my Question.

    Creating a Unique calculated column in both the tables and creating a relationship will provide the expected solution.

    here is the link from Microsoft Power Bi Community tutorial which has the solution:  https://youtu.be/GarBXef0Vew 

     

    Thanks

    Santosh Kumar P

6 Replies

  • It is not possible to join both tables with the common date and Item dimension and take results out?

    A calendar can be created in power BI.

    • SantoshKumar's avatar
      SantoshKumar
      Microsoft Employee

      amitchandakdata is huge and joining them is not a good option i think.

      below is the sample data posting for understanding. can you give me any reference of creating a calender , i will try to see whether it will work.

      Table1   
      IDItemCreatedDateTags
      1189615679/12/18 12:14 AMaa,bb,cc
      2189611699/11/18 11:46 PMaa,bb,cc
      3189604829/11/18 11:01 PMaa
      4189594389/11/18 9:54 PMbb
      5189593359/11/18 9:48 PMcc
          
          
      Table2   
      IDItemCreatedDateTags
      6189580229/11/18 4:47 PMbb,cc
      7189577269/11/18 6:08 AMaa,cc
      8189542409/11/18 5:28 AMbb
      9189539169/11/18 5:25 AMcc
      10189538839/11/18 5:23 AMaa
      • amitchandak's avatar
        amitchandak
        Super User
        Dates = Calendar( Date(2015, 1, 1), Date(2020,12,31))

        You can calculate Year, Month, etc as per need.

        For item See if the union, List.Union can work for you

  • SantoshKumar's avatar
    SantoshKumar
    Microsoft Employee

    This is the Sample data for reference.

    Table1   
    IDItemCreatedDateTags
    1189615679/12/18 12:14 AMaa,bb,cc
    2189611699/11/18 11:46 PMaa,bb,cc
    3189604829/11/18 11:01 PMaa
    4189594389/11/18 9:54 PMbb
    5189593359/11/18 9:48 PMcc
        
        
    Table2   
    IDItemCreatedDateTags
    6189580229/11/18 4:47 PMbb,cc
    7189577269/11/18 6:08 AMaa,cc
    8189542409/11/18 5:28 AMbb
    9189539169/11/18 5:25 AMcc
    10189538839/11/18 5:23 AMaa
  • SantoshKumar's avatar
    SantoshKumar
    Microsoft Employee

    Hi,

    I have got the answer for my Question.

    Creating a Unique calculated column in both the tables and creating a relationship will provide the expected solution.

    here is the link from Microsoft Power Bi Community tutorial which has the solution:  https://youtu.be/GarBXef0Vew 

     

    Thanks

    Santosh Kumar P