Forum Discussion
avioti
8 years agoFrequent Visitor
DAX SUM/distinct(Count)
Hello Guys Could you help me pls? I have a table called sales and has column with total sales and another collumn code_sales. I would like to sum (total sales) and divide by the quantity of code...
- Anonymous8 years ago
Yes. You could do it all within:
Your Measure = DIVIDE( SUM('Sales'[Total_Sales]), DISTINCTCOUNT('Sales'[Code_Sales]) )
Anonymous
8 years agoNot applicable
This can be done with a simple Matrix visual. Put 'Code Sales' as your rows and also again into the values. Select the dropdown for the values version and choose "Count (Distinct)"
avioti
8 years agoFrequent Visitor
I understand, but i would like to have this info in a table. Is it possible?
- Anonymous8 years agoNot applicable
Easy (but not the most optimal):
Start in Power Query (Edit query button). Make a new query and have the Source line be:Source = #"Sales"
Now delete all other columns except for [Code_Sales]
Now remove duplicates
Now sort.
Close & Apply.
Link this new table with the Sales tableCreate a new column and have it be:
My Distinct = [Your Measure]