Forum Discussion
REWINDER
4 years agoFrequent Visitor
Measure to filter rows based on two dates (begin and end date)
Hi everyone, I have been working on this problem for a couple of hours now and hope someone is able to help me solve this: Looking to get a measure with Active verhicles (>=Purchase date , <=Repl...
- 4 years ago
Hi,
I am not sure if I understood your data model correctly, but please try the below measure and put it together with Date[Year] column from Date Table.
#Vehicles Active = CALCULATE ( COUNTROWS ( FleetActivity ), FILTER ( ALL ( FleetActivity ), FleetActivity[PurchaseDate] <= MAX ( 'Date'[Date] ) && FleetActivity[ReplacementDate] >= MIN ( 'Date'[Date] ) ) )
Jihwan_Kim
Super User
4 years agoHi,
I am not sure if I understood your data model correctly, but please try the below measure and put it together with Date[Year] column from Date Table.
#Vehicles Active =
CALCULATE (
COUNTROWS ( FleetActivity ),
FILTER (
ALL ( FleetActivity ),
FleetActivity[PurchaseDate] <= MAX ( 'Date'[Date] )
&& FleetActivity[ReplacementDate] >= MIN ( 'Date'[Date] )
)
)