Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
User | Count |
---|---|
75 | |
74 | |
44 | |
31 | |
27 |
User | Count |
---|---|
99 | |
89 | |
52 | |
48 | |
46 |