Forum Discussion
cottrera
3 years agoPost Prodigy
DAX count if dates < or >= relating date
Hi I have two tables that are related via the Property Ref column. Table 1 - Property (1 row per property) Property Ref Address Inspection Date DAX - repair count < repair date DAX - ...
- 3 years ago
Hi, cottrera
You can try the following methods.
Column:
repair count < repair date = CALCULATE ( COUNT ( Repairs[Property Ref] ), FILTER ( Repairs, [Repair Date] < EARLIER ( 'Property'[Inspection Date] ) && [Property Ref] = EARLIER ( 'Property'[Property Ref] ) ) )repair count > repair date = CALCULATE ( COUNT ( Repairs[Property Ref] ), FILTER ( Repairs, [Repair Date] >= EARLIER ( 'Property'[Inspection Date] ) && [Property Ref] = EARLIER ( 'Property'[Property Ref] ) ) )Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-zhangti
3 years agoCommunity Support
Hi, cottrera
You can try the following methods.
Column:
repair count < repair date =
CALCULATE (
COUNT ( Repairs[Property Ref] ),
FILTER (
Repairs,
[Repair Date] < EARLIER ( 'Property'[Inspection Date] )
&& [Property Ref] = EARLIER ( 'Property'[Property Ref] )
)
)repair count > repair date =
CALCULATE (
COUNT ( Repairs[Property Ref] ),
FILTER (
Repairs,
[Repair Date] >= EARLIER ( 'Property'[Inspection Date] )
&& [Property Ref] = EARLIER ( 'Property'[Property Ref] )
)
)
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- cottrera3 years agoPost Prodigy
Thank you😀