Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

problem: Extracting lists and refer to query table

Dear Community,   I have a question concerining extracting lists in Power Query. So in my query I have multiple columns. One of them ist called "TeamID" an contains numbers. Another one is called "...
  • v-jingzhang's avatar
    3 years ago

    Hi Anonymous 

     

    You may try the following code for a new column:

    = let vTeamId = [TeamID] in List.Sum(List.Transform([statistics], each if [team_id] = vTeamId and Record.HasFields(_, "details") then List.Sum(List.Transform(_[details], each if _[type_id] = 321 then _[value][total] else 0)) else 0))

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.