The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Data set (Table name - Table1) has the insurance complaints inforamtion. I am trying to get the top 10 days where maximum complaints have been filed.
Below is the DAX query result. Its not sorted correctly. Can anyone tell what going wrong?
Solved! Go to Solution.
TOPN does not guarantee any sort order for the results.
If you're writing a DAX query, you can add and ORDER BY clause at the end. For example,
EVALUATE
TOPN (
10,
SUMMARIZECOLUMNS (
Table1[Received date],
"Complaint Count", COUNTROWS ( Table1 )
),
[Complaint Count], DESC
)
ORDER BY [Complaint Count] DESC
TOPN does not guarantee any sort order for the results.
If you're writing a DAX query, you can add and ORDER BY clause at the end. For example,
EVALUATE
TOPN (
10,
SUMMARIZECOLUMNS (
Table1[Received date],
"Complaint Count", COUNTROWS ( Table1 )
),
[Complaint Count], DESC
)
ORDER BY [Complaint Count] DESC
That worked. Thanks.
If I need to show this in report view, how do I do that?
Then you probably don't need any DAX. Just put the columns in a table visual, add a TopN filter in the filter pane, and sort by whichever one you want.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
21 | |
20 | |
17 | |
15 | |
13 |
User | Count |
---|---|
42 | |
36 | |
25 | |
22 | |
18 |