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.
Hi all, I am brand new to this forum so I apologise in advance if I do not give all the information that is required. I will however try and explain this as best as I can. I have a table as follows:
I have a table with thousands of rows. The two key columns of interest are included in the sample table I have provided below.
Order Number | Country |
36478849 | Ireland |
36478849 | Ireland |
22761993 | USA |
48475793 | Germany |
48475793 | Germany |
48475793 | Germany |
12436657 | USA |
I am trying to create a visual that gives me the Top country by number of sales order numbers. I also have some other filters that I have to apply but this isn't relevant to my query so I have not included the fields above. My desired result is for it to say:
Germany | 3 |
I did find away to achieve this using the filter menu as it allows you to do a Top N on the "Country" field but actually use the "Order Numbers" as the value it looks at. Please see below (Legal Entity is Country in my example).
The reason why this isn't good enough for me is because I need to be able to further manipulate this data into a pertage of other figures. This is why my thoughts were to create a meausre and to use the TopN function as part of a Calculate. Please see my DAX formula below:
Solved! Go to Solution.
Hi,
You may download my PBI file from here.
Hope this helps.
Hi,
You may download my PBI file from here.
Hope this helps.
Thank you so much Ashish. That worked great.
You are welcome.
it depend on what you enter to the dax topn parameters, its giving you the alphabetically order cause you use in the parameter the legaenititname instead of a value, if oyu want the topn by value, need to enter the column reference to the value result not the name
Proud to be a Super User!
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 |
---|---|
110 | |
95 | |
76 | |
65 | |
51 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |