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
Yes. You could do it all within:
Your Measure = DIVIDE(
SUM('Sales'[Total_Sales]),
DISTINCTCOUNT('Sales'[Code_Sales])
)- avioti8 years agoFrequent Visitor
Thanks for the response. It works fine.
Now i have another situation. How to show distinct values in a new column into my table?
Like below
For example:
Code Sales Distinct
1000 1
1000 0
2000 1
3000 1
4000 1
4000 0
- Anonymous8 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)"
- avioti8 years agoFrequent Visitor
I understand, but i would like to have this info in a table. Is it possible?