Categories: Power BI
Tags:

This is Part 4 Of the IPL Data Analysis project. In this part you will learn important questions that will help teams and team statisticians in understanding venue wise performance of other teams. Whether it is toss decision or home advantage, which team has the best performance score can be analyzed here.

You can get the datasets here: https://colorstech.net/data-analytics/ipl-2008-to-2024-dataset-for-data-analysis-interactive-dashboards/

IPL-venue-analysis

Here are the questions and important DAX codes used in the project

Dashboard 4:

  • Venue Analysis
  • Top venues by matches played
  • Venue-wise average scores
  • Team-wise win % by venue
Table 
TeamVenueWins =
SUMMARIZE (
    matches,
    matches[venue],
    matches[winner],
    "Wins", COUNTROWS(matches)
)
Measure
MatchesByTeamVenue = 
CALCULATE (
    COUNTROWS(matches),
    FILTER (
        matches,
        (matches[team1] = SELECTEDVALUE(TeamVenueWins[winner]) 
         || matches[team2] = SELECTEDVALUE(TeamVenueWins[winner]))
        && matches[venue] = SELECTEDVALUE(TeamVenueWins[venue])
    )
)
WinPercent = 
DIVIDE (
    SUM(TeamVenueWins[Wins]),
    [MatchesByTeamVenue],
    0
) * 100

 
Toss outcome and result pattern per venue
Table
TossVenueSummary =
SUMMARIZE (
    matches,
    matches[venue],
    matches[toss_decision],
    "TotalMatches", COUNTROWS(matches),
    "WinsWhenTossWon",
        CALCULATE (
            COUNTROWS(matches),
            matches[toss_winner] = matches[winner]
        )
) 
MEasure
TossWinPercent = 
DIVIDE (
    SUM(TossVenueSummary[WinsWhenTossWon]),
    SUM(TossVenueSummary[TotalMatches]),
    0
) * 100

Home vs away performance
TeamHomeVenues = DATATABLE(
    "Team", STRING,
    "HomeVenue", STRING,
    {
        {"Chennai Super Kings", "M. A. Chidambaram Stadium"},
        {"Mumbai Indians", "Wankhede Stadium"},
        {"Royal Challengers Bengaluru", "M. Chinnaswamy Stadium"},
        {"Delhi Capitals", "Arun Jaitley Stadium"},
        {"Rajasthan Royals", "Sawai Mansingh Stadium"},
        {"Sunrisers Hyderabad", "Rajiv Gandhi International Stadium"},
        {"Kolkata Knight Riders", "Eden Gardens"},
        {"Punjab Kings", "Punjab Cricket Association Stadium"},
        {"Gujarat Titans", "Narendra Modi Stadium"},
        {"Lucknow Super Giants", "BRSABV Ekana Cricket Stadium"}
    }
)


column in Matches
MatchResultLocation =
VAR HomeVenue = 
    LOOKUPVALUE(
        TeamHomeVenues[HomeVenue],
        TeamHomeVenues[Team], matches[winner]
    )
RETURN
    IF(matches[venue] = HomeVenue, "Home", "Away")


HomeWins =
CALCULATE(
    COUNTROWS(matches),
    matches[MatchResultLocation] = "Home"
)

AwayWins =
CALCULATE(
    COUNTROWS(matches),
    matches[MatchResultLocation] = "Away"
)

HomeWinPercent =
DIVIDE([HomeWins], [TotalWins], 0) * 100

AwayWinPercent =
DIVIDE([AwayWins], [TotalWins], 0) * 100