Forum Discussion
NMOORE
2 years agoHelper II
Dax Table Summarize using Lookup
Hi, I want to summarize a table keeping the corresponding values/Dates from a neighbouring column after an expression. As the example shows I'm hoping to summarize the animals, calculate the ...
- 2 years ago
IDEAL_Backtest_Details = ADDCOLUMNS( SUMMARIZE(Backtest_Details, Backtest_Details[Animals], "Analysis Date", min(Backtest_Details[Analysis Date]) ) , "Final Date", LOOKUPVALUE(Backtest_Details[Final Date], Backtest_Details[Animals], [Animals], Backtest_Details[Analysis Date], [Analysis Date]) )something like this?
IP: Backtest_Details
OP:
- 2 years ago
Thanks alot for this, I was playing around with it for a while trying to do exactly this but just couldnt get there. Much appreciated.
tamerj1
2 years agoCommunity Champion
Hi NMOORE
if you're looking for a calculated table solution, you may try
NewTable =
GENERATE (
VALUES ( 'Table'[Animals] ),
CALCULATETABLE (
TOPN (
1,
SELECTCOLUMNS (
'Table',
"Analysis Date", 'Table'[Analysis Date],
"Finalise Date", 'Table'[Finalise Date]
),
'Table'[Analysis Date], ASC
)
)
)
NMOORE
2 years agoHelper II
Hi, Thanks so much for your reply, I was trying to understand summarize and add columns better as I was half-way there but will look at understanding what you did here next week. Thanks again