Forum Discussion
cdcarnes
1 year agoFrequent Visitor
Count items on the most recent document by ID withing selected date range
I am having a hard time figuring this one out. I have a table similar to the one shown below EffectiveDate ID NoProblems 4/1/2025 1 Y 3/31/2025 5 NULL 3/28/2025 4 Y 3/26/...
- 1 year ago
cdcarnes Try:
Measure = VAR __Table = ADDCOLUMNS( SUMMARIZE( 'Table', [ID], "MaxDate", MAX('Table'[EffectiveDate] ) ), "__NoProblems", MAXX(FILTER( 'Table', [ID] = EARLIER('Table'[ID]) && [EffectiveDate] = [MaxDate]), [NoProblems] ) ) VAR __Table2 = FILTER( __Table, [__NoProblems] = "Y" ) VAR __Result = COUNTROWS( __Table2 ) RETURN __ResultPretty sure the answer is 10 not 8. PBIX attached below signature.
Greg_Deckler
Community Champion
1 year agocdcarnes Try:
Measure =
VAR __Table =
ADDCOLUMNS(
SUMMARIZE( 'Table', [ID], "MaxDate", MAX('Table'[EffectiveDate] ) ),
"__NoProblems", MAXX(FILTER( 'Table', [ID] = EARLIER('Table'[ID]) && [EffectiveDate] = [MaxDate]), [NoProblems] )
)
VAR __Table2 = FILTER( __Table, [__NoProblems] = "Y" )
VAR __Result = COUNTROWS( __Table2 )
RETURN
__Result
Pretty sure the answer is 10 not 8. PBIX attached below signature.
cdcarnes
1 year agoFrequent Visitor
That worked. Thank you so much for your help.