Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Power BI Table Relationship Between DimDate & a table contains multiple date columns

Hello All,

 

We have a DimDate table which is our Date Dimension table. We have a Incident_Detail data table which contains following date column(s):

1) Created_Date
2) Cancelled_Date
3) Resolved_Date
4) Closed_Date
5) Re Opened_Date
6) Open_Date

 

Now we need to create following measure(s) based on Reporting date slicer which is date column from DimDate

  1. Total Incident Created
  2. Total Incident Cancelled 
  3. Total Incident Resolved
  4. Total Incident Closed
  5. Total Incident Re Opened
  6. Total Incident Open

 

We need to understand how to make relationship so that these measures can be created & it will give correct values.

 

 

Thanks,

PBI V2

  • Anonymous 

    you can link the dimdate to al the columns. 

    ( you will have 1 active relationship, and all the remaining will be inactive )  ( set the active relationship to the date that you will mostly be using in the report ).

     

     

    now create a measure for each calculation, and use userelationship, to activate the relationship that you want your measure to be based on 


    calculation pattern : calculate (   calculation ,   userelationship( dimdate[date], table[datecolumn) )

     

    datecolumn will depend on the measure you are calculating. 

     

    hope this helps. 

     

2 Replies

  • Daniel29195's avatar
    Daniel29195
    Icon for Community Champion rankCommunity Champion

    Anonymous 

    you can link the dimdate to al the columns. 

    ( you will have 1 active relationship, and all the remaining will be inactive )  ( set the active relationship to the date that you will mostly be using in the report ).

     

     

    now create a measure for each calculation, and use userelationship, to activate the relationship that you want your measure to be based on 


    calculation pattern : calculate (   calculation ,   userelationship( dimdate[date], table[datecolumn) )

     

    datecolumn will depend on the measure you are calculating. 

     

    hope this helps. 

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello Daniel29195

       

      Wow, Thanks for the elegant solution!

       

      Thanks,

      PBI V2