Forum Discussion

donalmcnamee2's avatar
donalmcnamee2
New Member
3 years ago
Solved

Using DATESBETWEEN and FILTER

Hi,    I have two unrelated tables:  Fuel Purchases Days Worked The Fuel Purchases table records the date a vehicle refuled as well as the date it was previously refuled. The table Days Worke...
  • MahyarTF's avatar
    MahyarTF
    3 years ago

    Hi,

    did you create the column or measure ?

    I did the column and it worked.

     

    Appreciate your Kudos

  • Ashish_Mathur's avatar
    Ashish_Mathur
    3 years ago

    Hi,

    This calculated column formula works

    Column = CALCULATE(COUNT('Days Worked'[Date]),FILTER('Days Worked','Days Worked'[Vehicle Registration]=EARLIER('Fuel Purchases'[Vehicle Registration])&&'Days Worked'[Date]>=EARLIER('Fuel Purchases'[Last Fuel Purchase Date])&&'Days Worked'[Date]<=EARLIER('Fuel Purchases'[Fuel Purchase Date])&&'Days Worked'[Has the vehicle worked today?]=TRUE()))

    Hope this helps.