Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey!
I have unfortunately not found an answer to this question yet. I have a dataset that includes products, a product line, and the number of orders (calculated with a count measure). Now I want to know what the percentage of orders is per product per productline. So for example:
Products, Product Line, Number of Orders
Shampoo, Hair, 5
Conditioner, Hair, 10
Mascara, Make-up, 30
Lipstick, Make-up, 50
Eyeshadow, Make-up, 20
Now the conditioner should have a percentage of 66,7% and the Lipstick should be 50%. Anyone an idea of how to do this in the set analysis? I want to show it in a table.
Thanks in advance!
Can you try:
=Sum([Number of Orders])
/
Sum(Total <[Product Line]> [Number of Orders])
Can you try:
=Sum([Number of Orders])
/
Sum(Total <[Product Line]> [Number of Orders])
This doesn't work sadly (says that they expect a ')' ). I'm using a count function to count the number of orders, does that influence it?
It shouldnt be missing any ')', and I believe you should be using Sum for this type of calculation ()
Yeah there's also not any bracket missing so I think it's some general message that it doesn't work.. Also I see I didn't explain this clearly in the post, but the database contains all the orders, so I'm counting the order numbers (sum isn't an option).
I noticed now that it does not work if I use "count(total distinct <[Product Line]> [Orders])", and instead I can use "count(distinct total <[Product Line]> [Orders])" in the count function.
However, the number of orders differs from the true number of orders, so it is still not working properly unfortunately
Ah I figured out where the difference came from, and it's a small nuance in my own data. Thank you for your solution, it works!