Forum Discussion

wrchto's avatar
wrchto
New Member
3 years ago
Solved

Relation between single date and date period

Hi all,

 

I have one table with timebookings, 

another table with hourly rates for time periods.

What I try is to calculate the costs per timebooking. I want to get a new column in my timebooking table like this:

I am not able to get a relationship between these tables. 

Can anybody please help me with this problem?

 

Best regards

Thomas

  • Hi wrchto , you need write this en calculate column:

    Unit Cost = CALCULATE(MAX('Table 2'[Hourly Rate]),
        FILTER(ALL('Table 2'),'Table 2'[to]>='Table 1'[Date] && 'Table 2'[from]<='Table 1'[Date] && 'Table 1'[Company] = 'Table 2'[Company]))
     
    - After, calculate total cost:

    - Result:

    Best regards

     

     

2 Replies

  • Hi wrchto , you need write this en calculate column:

    Unit Cost = CALCULATE(MAX('Table 2'[Hourly Rate]),
        FILTER(ALL('Table 2'),'Table 2'[to]>='Table 1'[Date] && 'Table 2'[from]<='Table 1'[Date] && 'Table 1'[Company] = 'Table 2'[Company]))
     
    - After, calculate total cost:

    - Result:

    Best regards

     

     

  • Dear Bifinity_75 ,

     

    Thank you so much, that solved my problem, and I also have learned from that!

     

    Best regards

    Thomas