Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
When I use TopN for 2 it gives me more than 2 records back ... it gives me all the records that have one of the 2 maximum numbers. How can I restrict the output to 2? And if multiple values have the maximum number it should choose a random sample....
Example:
A: 3
B: 7
C: 7
D : 7
E: 4
-> Top 2 gives me C,D,B, E (because the 2 maximum numbers are 7 and 4) but I just want C and D (or C and B ... does not matter, but just 2).
Can you help me?
~Anna
Solved! Go to Solution.
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
First, put the Top 2 Numbers into a table VAR (which will return 3 rows of Number 7).
Second, get the Top 2 Letters from the table VAR in Step 1 above.
Regards,
Nathan
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
39 | |
21 | |
21 | |
14 | |
13 |
User | Count |
---|---|
44 | |
32 | |
30 | |
18 | |
17 |