Forum Discussion
Anonymous
6 years agoNot applicable
Return a value from a specific row
I feel like this should be easy but I am having trouble. pretty much what I have is a table with these values: ChallengeID Progress UserCount ABD-5FGD 1200 67 ABD...
- 6 years ago
Hi Bigascon,
If you need it as a calculated column this should work. I am not sure if it is the fastest way. Maybe somebody has a faster way:)
Usercount max progress = //calculate maxprogress for challengeid VAR MAXPROGRESS = CALCULATE ( MAX ( 'example'[Progress] ), FILTER ( 'example', 'example'[ChallengeID] = EARLIER ( 'example'[ChallengeID] ) ) ) //calculate usercount for row that contains maxprogress (highest if 2 rows are equal in progress VAR USERCOUNT = CALCULATE ( MAXX ( FILTER ( 'example', 'example'[Progress] = MAXPROGRESS ), 'example'[UserCount] ), ALLEXCEPT ( 'example', 'example'[ChallengeID] ) ) RETURN USERCOUNT
jeroendekker
6 years agoFrequent Visitor
Hi Bigascon,
If you need it as a calculated column this should work. I am not sure if it is the fastest way. Maybe somebody has a faster way:)
Usercount max progress =
//calculate maxprogress for challengeid
VAR MAXPROGRESS =
CALCULATE (
MAX ( 'example'[Progress] ),
FILTER (
'example',
'example'[ChallengeID] = EARLIER ( 'example'[ChallengeID] )
)
) //calculate usercount for row that contains maxprogress (highest if 2 rows are equal in progress
VAR USERCOUNT =
CALCULATE (
MAXX (
FILTER ( 'example', 'example'[Progress] = MAXPROGRESS ),
'example'[UserCount]
),
ALLEXCEPT ( 'example', 'example'[ChallengeID] )
)
RETURN
USERCOUNT