Forum Discussion

kolturra's avatar
kolturra
Icon for Helper IV rankHelper IV
7 years ago
Solved

Relationship and Calculation between Tables with Time Series Data

Hi, I am trying to understand whether DAX or Relationship works to get date & time results, below the two tables for your reference. I have attached excel file in below link https://github.com/kolt...
  • v-xicai's avatar
    7 years ago

    Hi kolturra ,

     

    You can create columns in 'Break Table' like DAX below.

     

    Cost in Rupees =

    var d1 = maxx(TOPN(1,FILTER('Cost details','Cost details'[Start D & T]<='Break Table'[Start D & T]),'Cost details'[Start D & T],DESC),'Cost details'[No Job Cost in Rupees])

    var d2 = maxx(TOPN(1,FILTER('Cost details','Cost details'[Start D & T]<='Break Table'[Start D & T]),'Cost details'[Start D & T],DESC),'Cost details'[Cost in Rupees])

    return

    IF('Break Table'[Reason]="No job", IF(d1=BLANK(),d2,d1),d2)

     

    Loss in Rupees = 'Break Table'[Break Time in Minutes]*'Break Table'[Cost in Rupees]

     

     

     

     

     

     

     

     

     

    Best Regards,

    Amy

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.