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]) )
avioti
8 years agoFrequent Visitor
I understand, but i would like to have this info in a table. Is it possible?
Anonymous
8 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 table
Create a new column and have it be:
My Distinct = [Your Measure]