Forum Discussion
Ranking Customers
Hi Everyone,
I am still new to Power BI, but today I feel as if I have learned alot and started putting good measures together. I am currently trying to put together a measure that will show the Top 10 customers that we have with the amount of items that they have purchased. I would also like to expand this later by taking that further and showing each customer and the individual products they purchased. We only have 6-8 items that we sell, but really 99% of the items that we sell are one of 3 items. Each customer has a row created each time they purchase one item. One row means one item. I was trying to perform an initial countrows measure and have that show up per customer. Then do a rankx measure to pull the top 10 desc. When I pull the final measure onto a chart to see the data before expanding, many times I get a chart with each customer on the list and the number 1 as the total for each customer.
Any help would be appreciated. Here is what I have so far.
I first calculated the rows of the column with the customers name. I had to get rid of blank customer rows first as they can be scattered throughout. (We deal with very sensitive data so I have made the column names generic).
Hi,
Try this measure
=calculate([NoBlankTotalCustomers],top(10,all(Table1_Sales[CustomerName]),[NoBlankTotalCustomers]),VALUES(Table1_Sales[CustomerName]))
3 Replies
- Ashish_MathurSuper User
Hi,
Try this measure
=calculate([NoBlankTotalCustomers],top(10,all(Table1_Sales[CustomerName]),[NoBlankTotalCustomers]),VALUES(Table1_Sales[CustomerName]))
- dbrandoneHelper IV
Thanks for sending me that measure Ashish_Mathur. I received an error on the "Top" filter. I instead was able to figure out a way to take the "NoBlankTotalCustomers" measure with the Customer Name column in a table and then filter the visual using Top N and then sort DESC by TotalCustomers.
Now I just need to figure out a way to then take the list that I have now and take the total customers column that has a number attached with it and then branch off and show the amount of each item they purchased to get to that number.
- Ashish_MathurSuper User
Hi,
My proposed measure is correct. I cannot what istake you are committing.