Forum Discussion

darko861's avatar
darko861
Icon for Resolver II rankResolver II
4 years ago
Solved

Return a text value from a calculated column with DAX

Hi community,

 

I have written the below Dax measure, this does not work due to the string highlighted in red. PUFIRMA[FTG] refers to a calculated column in a table. This column contains the names of the companies with the highest sales.

How can I tweak this syntax in order to retrieve the names of the companies in the calculated column? I have tried to wrap it around different functions, like Values(), but I cannot get the desired output. The RANKX works perfectly, but I'm not able to extract the names of the respective company with the highest sales.

 

RankbySales_x3 =
VAR RankbySales2 =RANKX(all(PUFIRMA[FTG]),Measures_T[Rank_sum],,DESC)
return
IF(RankbySales2<=11,PUFIRMA[FTG],"Others")
 
Desired output: