Forum Discussion
Dax Top 1 Name
- 8 years ago
Try with
= CALCULATE ( MAX ( [GICS Level] ), FILTER ( VALUES ( ContributionCategory[SECTOR] ), RANKX ( ALL ( ContributionCategory[SECTOR] ), [EndWeightBanchmark],, DESC ) = 1 ) )
I think you will need to modify the table parameter of RANKX
But not sure
RANKX(CALCULATETABLE(VALUES(ContributionCategory[SECTOR]),[VALUES]<>BLANK())
Hi,
Zubair_MuhammadThanks for kind reply,
I tried with
here my fields and table are different but scenario is same , I m not getting value on first
rank , getting blank value on first rank
any other solution ?
- Zubair_Muhammad8 years ago
Community Champion
- kjshah50308 years agoFrequent Visitor
here is code , which I have tried ,u can see
var first = CALCULATE(
MAX( Sect[Security Name]),
FILTER(
VALUES ( ContributionCategory ),
ContributionCategory[SECTOR] = thiredPortfolio
),
FILTER(Sect,
Sect[Security Name] <> BLANK()
),
FILTER (
VALUES( Sect[Security Name] ),
RANKX ( ALLNOBLANKROW ( Sect[Security Name] ), AllMeasure[Total Return Contribution],, DESC ) = 1
)
)
Here , I m trying to get top 1 with ignoring blank or empty
when I tried with RANKX ( ALLNOBLANKROW ( Sect[Security Name] ), AllMeasure[Total Return Contribution],, DESC ) = 6
then I got my expected result but this is not perfact , bacause all the 1 to 5 ranks results is blank or empty ,
so i want ignore all five ... and ,
always I want my result in first rank(ignoring all blank or empty values) - kjshah50308 years agoFrequent Visitor
Hi
Zubair_Muhammad
I found one more solution , I have recently checked the value, is not blank but it is nontext value.
so now I want to use ISNONTEXT() for check whether it is text or not. I want only text value rank by desc ,
so how can I use ISNONTEXT() in RANKX() ?I tried but not getting proper result. so can you please help one more time?