Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
ajinkya1907
Helper II
Helper II

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 🙂

 

 

1 ACCEPTED SOLUTION
2 REPLIES 2
Zubair_Muhammad
Community Champion
Community Champion

Hi @ajinkya1907

 

Try this MEASURE. then Put it in a TABLE VISUAL with TEAM 1

 

Measure =
CONCATENATEX (
    TOPN ( 5, matches, [date], DESC ),
    IF (
        CALCULATE ( VALUES ( matches[winner] ) ) = SELECTEDVALUE ( matches[team1] ),
        "Won",
        "Lost"
    ),
    " ",
    [date], DESC
)

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.