Forum Discussion
Finding the most recent value
- 9 years ago
Thank you- I see the logic in your approach but I am having trouble with the synax for the "Earlier" section. Per your note, I did the following:
MaxDate = CALCULATE(MAX('Community Leadership Assessment (2)'[Date Talken ], FILTER('Community Leadership Assessment (2)','Community Leadership Assessment (2)'[Name]=EARLIER('Community Leadership Assessment (2)'[Name]))))
But i got this error-A single value for column 'Date Talken ' in table 'Community Leadership Assessment (2)' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.
Any thoughts?
Anonymous wrote:
Hi LAndes
Please try the following
1. Create a column called MaxDate
MaxDate =
CALCULATE(MAX(yourtablename[yourDatecolumn]),FILTER(yourtablename[Name]=EARLIER(yourtablename[Name])))
What this does is computes the MaxDate by Name and popluates in all records grouping by Name.
2. Create a column called IsLatest
IsLatest = If([Date]=[MaxDate],"Latest","Older")
3. Now create a report with relevant columns from yourtablename and use IsLatest column as a Visual Level Filter filtered for "Latest".
Check it out.
If it works please accept this as a solution and also give KUDOS.
Cheers
CheenuSing
Anonymous The below code works well for my requirement:
KPI= COUNTROWS (
FILTER (
ADDCOLUMNS (
CALCULATETABLE (
SUMMARIZE (
'Table1',
'Table1'[ID],
Table1[SalesRepName],
"Rep",Table1[SalesRepName],
"POP", 'Table1'[ID],
"Latest", MAX ( 'Table1'[Date] )
),Table1[KPI] in {0,1}
),
"Response", LOOKUPVALUE (
'Tabke1'[KPI],
'Table1'[ID], [POP],
Table1[SalesRepName],[Rep],
'Table1'[ActivationStandard],1,
'Table1'[Date], [Latest]
)
),
[Response]
)
)
I basically wanted to make it so that the "Latest" is dynamic by the date filter as I'm building a dynamic reporting on a few surveys which should ideally not require republishing. This makes it so.