Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Max value with multiple criteria

Hi All,

 

I have a table like below. I want to get the maximum value from the same grid and within the same week, but the expected result that the value displayed in the max value column is IP Name. Grid's name is very unique.

 

WeekGridIP NameValueMax Grid
1HA4A
1IA3A
1JC1A
1JA4A
1JB3A
1KC5C
1KA4C
2LD1A
2LC2A
2LA4A
2ME5E

 

 

Any help would be great. Ready to share my data and/or pbix file if needed.

Thanks

 

  • Anonymous , Assuming you need the last column

     

    Create a new column

     

    max Grid =
    var _max = maxx(filter(Table,[Week] = earlier([Week]) && [Grid] = earlier([Grid])),[value])
    return
    maxx(filter(Table,[Week] = earlier([Week]) && [Grid] = earlier([Grid]) && [value] =_max ),[ IP Name])

3 Replies

  • Anonymous , Assuming you need the last column

     

    Create a new column

     

    max Grid =
    var _max = maxx(filter(Table,[Week] = earlier([Week]) && [Grid] = earlier([Grid])),[value])
    return
    maxx(filter(Table,[Week] = earlier([Week]) && [Grid] = earlier([Grid]) && [value] =_max ),[ IP Name])

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi amitchandak

       

      Thanks for your helping me.

       

      How about lookupvalue? is it possible to use it?

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi @

       

      Will you help again? What if I put another filter in the EXP column, where if the value "BB" is found, that value will be excluded. So the results obtained in the column "new max grid" are as follows :

       

      WeekGridIP NameValueExpMax GridNew Max Grid
      1HA4AAAA
      1IA3AAAA
      1JC1AAAB
      1JA4BBAB
      1JB3AAAB
      1KC5AACC
      1KA4AACC
      2LD1AAAC
      2LC2AAAC
      2LA4BBAC
      2ME5AAEE

       

      Thanks