Forum Discussion
Top N working differently than expected
Hi,
There are many questions around Top N however I couldnt find one specific to my situation.
I have a table of invoices for items, each has a unit price.
ItemA 10.00 ItemA 12.00 ItemB 15.00 ItemB 16.00 ItemA 200.00 ItemC 29.99
I need to show items that have the biggest standard deviation in price by Item. I have created a table that simpley has Item and unitprice displayed as "standard deviation" and that works fine (fig A).
Fig A
My next challenge os to show the Top 20 rows only so my report is not cluttered. I selected Item, visual filter, Top N then Top 20 by unit cost (standard deviation) but it shows some subset of the results that I simply dont understand. See Fig B
Fig B
Any ideas what Im doing wrong? I just expoect to see 10 rows of data.
Cheers
Hi cnschulz,
I am sorry to misunderstand you, I have tested it again, you could refer to below picture:
And I think if you want to order the items by value, you need to calculate the top n based on the value you could refer to below link:
https://powerbi.microsoft.com/en-us/blog/power-bi-desktop-october-feature-summary/
Regards,
Daniel He
4 Replies
- v-danhe-msft
Microsoft Employee
Hi cnschulz,
Based on my test, it could work on my side.
Sample data:
Result:
Could you please share your pbix file if possible?
Regards,
Daniel He
- cnschulz
Helper IV
Cheers, I cant suply the pbix as is violates our compant policy...
Two things with your example:
1. You only have one occurance of each item in your sample. My example has multiple (which the SD is calculated against)
2. You are calculating top n based on the value only, whereas I need the Top N standard deviations for each item.
Cheers
- v-danhe-msft
Microsoft Employee
Hi cnschulz,
I am sorry to misunderstand you, I have tested it again, you could refer to below picture:
And I think if you want to order the items by value, you need to calculate the top n based on the value you could refer to below link:
https://powerbi.microsoft.com/en-us/blog/power-bi-desktop-october-feature-summary/
Regards,
Daniel He