Forum Discussion
Using DATESBETWEEN and FILTER
- 4 years ago
Hi,
did you create the column or measure ?
I did the column and it worked.
Appreciate your Kudos
- 4 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.
Hi,
I did create the measure in Fuel Purchase table as below :
Appreciate your Kudos
- donalmcnamee24 years agoNew Member
That's exactly what I'm looking for!
However, when I try to recreat it, I'm getting a different result to the one you're getting.
It must be something simple as the data set you're using is exactyl the same as mine.
My PIBX can be found here if you would like to take a look: https://dl.archwayproducts.com/downloads/BI/query.pbix
Many thanks!
- MahyarTF4 years agoMemorable Member
Hi,
did you create the column or measure ?
I did the column and it worked.
Appreciate your Kudos
- donalmcnamee24 years agoNew Member
Yes, using a Calclulated Column instead of a Measure worked great.
- Ashish_Mathur4 years agoSuper User
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.
- donalmcnamee24 years agoNew Member