Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

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

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@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])

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@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
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

Anonymous
Not applicable

Hi @amitchandak

 

Thanks for your helping me.

 

How about lookupvalue? is it possible to use it?

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.