Forum Discussion

Kumshan450's avatar
Kumshan450
Icon for Helper III rankHelper III
7 years ago

Linking 2 dates to one Master Calendar (USERELATIONSHIP) and finding out datediff

I want to find datediff between dates in two differenct table - Receipt data and Deposition data. 

 

I want to find find below DAX Measure and Measure name is 0-3 days

 

Name for dax mesure -

 

Sumx( If date in deposition data is not blank,Then find and check difference between in date of receipt date and date in deposition slip date is  less than 3 than 1, o)

 

Both table Receipt data and Deposition data are linked to a master calender table (one active and another inactive)

 

How to use related and usarelaionshhip to do vlookup and find the datedif 

 

 

3 Replies

  • v-jiascu-msft's avatar
    v-jiascu-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi Kumshan450,

     

    1. They are two tables. Why is it that the relationships are one active and another inactive?

    2. Can you share a sample? Please mask the sensitive parts.

     

     

    Best Regards,

    • Kumshan450's avatar
      Kumshan450
      Icon for Helper III rankHelper III

      I am sharing you the another model file where there is sales data containing date and another one Refunds containing Refund date.

       

      Date in sales data and date in refund data both are linked to a master calender date data. 

       

      I want to calculate dax measures

       

      if date in refund data is not blank 

       

      then find if the difference between the refund date and sale date exceeds more than 15 days 

       

      if it exceeds 15 days then 1 elso 0

       

      This will help me to fund the abnormal duration between sale data and refund date. 

      • v-jiascu-msft's avatar
        v-jiascu-msft
        Icon for Microsoft Employee rankMicrosoft Employee

        Hi Kumshan450,

         

        I'm afraid you can't get the date diff in your model. There should be a column like SaleID. If your model is as you described, the result always is 0. For instance, if the Sale date is 2019-01-01, we will find the Calendar date is 2019-01-01 and the Refund date is 2019-01-01 along the relationships. The days will be 0.

        Can you share a dummy sample?

         

        Best Regards,