Skip to content

Instantly share code, notes, and snippets.

@PBI-DataVizzle
Last active October 4, 2022 08:15
Show Gist options
  • Select an option

  • Save PBI-DataVizzle/c6d8ff0c62c399c47f18507d492bf868 to your computer and use it in GitHub Desktop.

Select an option

Save PBI-DataVizzle/c6d8ff0c62c399c47f18507d492bf868 to your computer and use it in GitHub Desktop.
25 Days of DAX Fridays - Day1
Day1 Answer =
var _result =
MAXX(
TOPN( 1, // return top 1
VALUES( tournaments_standings[team_name] ), // iterate over tournaments_standings table
CALCULATE(
COUNTROWS( tournaments_standings ), // count all rows in table
tournaments_standings[position] = 1 // where position is first place
) ,
DESC // sort descending
) ,
[team_name] // return the max value of the [tean_name] column
)
RETURN
_result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment