Forum Discussion
Topn error
Hi,
Can Anyone help,
Why my TOPN not filting the value, Its showing below error
The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.
11 Replies
- rajendraongole1Super User
Hi Anonymous - can you try below measure
Test for TOP =
TOPN(3,
FILTER('2425', '2425'[SBUName]="AI & ML"),
'2425'[ValuesinLakhs],
DESC
)Hope it works
- AnonymousNot applicable
Hi Raju,
Its says same error..
- rajendraongole1Super User
Hi Anonymous - can you try below updated with sumx
Test for TOP =
TOPN(
3,
FILTER('2425', '2425'[SBUName] = "AI & ML"),
SUMX('2425', '2425'[ValuesinLakhs]),
DESC
)
- FreemanZSuper User
hi Anonymous ,
TOPN returns a table, you can't CALCULATE a table directly. What do you plan to do with the top3 table?
- AnonymousNot applicable
Hi Freeman,
i am trying to get top 3 customer from the given table based on condition
- AnonymousNot applicable
Hi Raju,
Now its working Fine otherthen TOPN.
Test for TOP =--Var _SV=SELECTEDVALUE(SBUTarget[SBUName])Var _Tp=TOPN(3,ALLSELECTED('2425'[Customer Name]),'2425'[Achv_Val])RETURNCALCULATE('2425'[Achv_Val],--FILTER('2425','2425'[Achv_Val]>10))KEEPFILTERS(FILTER('2425','2425'[Achv_Val]>10 && '2425'[SBUName]= "AI & ML" ||'2425'[Achv_Val]>5 && '2425'[SBUName]= "AV" ||'2425'[Achv_Val]>5 && '2425'[SBUName]= "Cloud" ||'2425'[Achv_Val]>5 && '2425'[SBUName]= "PCS" ||'2425'[Achv_Val]>5 && '2425'[SBUName]= "ECS" ||'2425'[Achv_Val]>5 && '2425'[SBUName]= "ESS" ||'2425'[Achv_Val]>5 && '2425'[SBUName]= "NWA" ||'2425'[Achv_Val]>5 && '2425'[SBUName]= "SCS" ||'2425'[Achv_Val]>5 && '2425'[SBUName]= "PWR" ||'2425'[Achv_Val]>5 && '2425'[SBUName]= "SERVICE" ||'2425'[Achv_Val]>5 && '2425'[SBUName]= "IMS" ||'2425'[Achv_Val]>5 && '2425'[SBUName]= "PS")--'2425Rag'[SBUName]=_SV))