Bjorn Morrhaye
Bjorn Morrhaye

Reputation: 731

Find matching value in query based on text

I am building a table in power query and I want to find the matching value from a column in a row. Does anyone know how to do this? I import my source data with:

leagueDataSource = #"League Data All",

this gives me this table:

table

I then have a variable called:

leagueName = "Albania - Superliga",

and want to create another variable called activeSeason. How do I match the variable leagueName with the value in active Season ?

Upvotes: 0

Views: 62

Answers (1)

Bjorn Morrhaye
Bjorn Morrhaye

Reputation: 731

Found the answer myself :)

leagueName = "name",
a = List.PositionOf(leagueDataSource[League], leagueName, 0),
leagueID = Number.ToText(leagueDataSource[Active Season]{a}),

Upvotes: 1

Related Questions