Forum Discussion

ajinkya1907's avatar
ajinkya1907
Helper II
8 years ago
Solved

Display the list

Dear Friends,

 

I am using IPL Crikcet Data set which can be found on

https://drive.google.com/open?id=1DOyDC2V1XE7BUAMNzQeT9HzfuIYDEQ5f

 

I would like to calculate Team's latest form (Latest 5 Matches)

 

That is Team Name = Win Win Lost Win Lost

 

Latest Form =

var team = SELECTCOLUMNS(matches,"Team1",matches[winner])

 

var temp = FILTER(SUMMARIZE(matches,
matches[winner],
matches[date],
"form", IF(COUNT(matches[winner])>0,"W","L")),
(CALCULATE(COUNTROWS(ALLSELECTED(matches)),FILTER(ALLSELECTED(matches),matches[team1]=team)) +
CALCULATE(COUNTROWS(ALLSELECTED(matches)),FILTER(ALLSELECTED(matches),matches[team2]=team))
) >=1 )

return MAXX(TOPN(5,temp,[date],DESC),[form])

 

This calculated measure is giving an error. I even tried creating Table but still getting the same error. Kindly suggest possible solution.

 

Zubair_Muhammad - Tagging you explicitely as you know the dataset and also cricket very well :-)