Forum Discussion
Filtering a table with date dependency
- 4 years ago
Hi Anonymous ,
According to your description, here's my solution. I have two methods.
Method 1
1.Create a new table.
Table 2 = FILTER ( ALL ( 'Table' ), MINX ( FILTER ( ALL ( 'Table' ), 'Table'[SN] = EARLIER ( 'Table'[SN] ) ), 'Table'[Status] ) = "passed" )Get the expected table.
2.Create a measure.
Count' = COUNTROWS('Table 2')Get the correct count.
Method 2
1. Create a measure.
Check = IF ( MINX ( FILTER ( ALL ( 'Table' ), 'Table'[SN] = MAX ( 'Table'[SN] ) ), 'Table'[Status] ) = "passed", 1, 0 )Select the visual, put the check measure in the visual filter, then select the value is 1.
Get the expected result.
2.Create another measure.
Count = CALCULATE ( COUNT ( 'Table'[SN] ), FILTER ( ALL ( 'Table' ), MINX ( FILTER ( ALL ( 'Table' ), 'Table'[SN] = EARLIER ( 'Table'[SN] ) ), 'Table'[Status] ) = "passed" ) )Get the correct count.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
According to your description, here's my solution. I have two methods.
Method 1
1.Create a new table.
Table 2 =
FILTER (
ALL ( 'Table' ),
MINX (
FILTER ( ALL ( 'Table' ), 'Table'[SN] = EARLIER ( 'Table'[SN] ) ),
'Table'[Status]
) = "passed"
)
Get the expected table.
2.Create a measure.
Count' = COUNTROWS('Table 2')
Get the correct count.
Method 2
1. Create a measure.
Check =
IF (
MINX (
FILTER ( ALL ( 'Table' ), 'Table'[SN] = MAX ( 'Table'[SN] ) ),
'Table'[Status]
) = "passed",
1,
0
)
Select the visual, put the check measure in the visual filter, then select the value is 1.
Get the expected result.
2.Create another measure.
Count =
CALCULATE (
COUNT ( 'Table'[SN] ),
FILTER (
ALL ( 'Table' ),
MINX (
FILTER ( ALL ( 'Table' ), 'Table'[SN] = EARLIER ( 'Table'[SN] ) ),
'Table'[Status]
) = "passed"
)
)
Get the correct count.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.