Forum Discussion

AnkitKukreja's avatar
AnkitKukreja
Super User
5 years ago
Solved

Count Final Wins

Hi All,   I want to count the wins from the dataset below. The stage Fin refers to finals and there are 7 games in each final, so the games 1-5 in 1991 finals and 1-6 in 1992 is final games for tha...
  • jameszhang0805's avatar
    5 years ago

    Not sure if this is the result you want, but I didn't find the team information in your data source, so I created a calculated column Year for dimension.

     

    #Win = 
    VAR _Table =
        CALCULATETABLE (
            SUMMARIZE ( 'Table', 'Table'[Year], 'Table'[Games], 'Table'[Result] ),
            'Table'[Stage] = "FIN",
            'Table'[Result] = "W"
        )
    VAR _GROUPBY =
        GROUPBY ( _Table, 'Table'[Year], "@Win", SUMX ( CURRENTGROUP (), 1 ) )
    VAR _Filtered =
        FILTER ( _GROUPBY, [@Win] >= 4 )
    RETURN
        COUNTROWS ( _Filtered )