The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi,
I created user defined list and tried to perform TopN. While it is returning entire list,
measure= var __list={1,5,4,2,3,1,3}
return minx(topN(2,__list,__list,DESC),[value])
I am not sure of the reason for this. If I return topN(2,__list), it returns 1,5 which are not is Desc order. Help me sort it in Desc order.
Hello @DeepikaHegde,
Can you please try this:
Measure =
VAR __list = {1, 5, 4, 2, 3, 1, 3}
VAR __table = ADDCOLUMNS( GENERATESERIES(1, COUNTROWS(__list)), "Value", __list[Value] )
RETURN MINX( TOPN(2, __table, [Value], DESC), [Value] )
Should you have any questions or require further assistance, please do not hesitate to reach out to me.