Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DAX: distinct count using multiple columns

My table includes bunch of duplicated sales information for individual sellers, and I basically created a column and a measure which flags users whether the view they have includes duplicated sales information.

here is a very simplified example of what my table looked like

SalesManager  SalesPersonnel   Acccount   Product  Revenue
SalesManager1 SalesPersonnel1 Acccount_A Product_A 100000
SalesManager1 SalesPersonnel1 Acccount_B Product_C 100000
SalesManager1 SalesPersonnel3 Acccount_A Product_A 100000
SalesManager2 SalesPersonnel3 Acccount_B Product_C 100000
SalesManager1 SalesPersonnel2 Acccount_B Product_C 100000
SalesManager1 SalesPersonnel2 Acccount_B Product_C 100000
SalesManager4 SalesPersonnel4 Acccount_B Product_A 100000
SalesManager4 SalesPersonnel4 Acccount_A Product_D 100000
SalesManager4 SalesPersonnel5 Acccount_A Product_B 100000
SalesManager4 SalesPersonnel5 Acccount_A Product_A 100000

I then created a column

=Acccount&Product&Revenue

This is an extremely simplified example, in my real workbook, I have 30+ columns that I have to combine.

and a measure

= if(CALCULATE(DISTINCTCOUNT([ConsldforDupeCheck]))=COUNTROWS(Table),"","*PossibleDoubleCountError*"

This has been working quite well, except I found that the calculated column that combines bunch of the columns is causing the file size to double...

the only solution I can think of is if I can move the calculated column into measure, but I cannot think of a way to use distinctcount on multiple columns.

Is this possible?

like image 480
user2669043 Avatar asked Oct 27 '25 11:10

user2669043


1 Answers

Try this:

My Distinct Count := COUNTROWS(
 SUMMARIZE('Your Table','Your Table'[Account],'Your Table'[Product],'Your Table'[Revenue])
)
like image 153
GregGalloway Avatar answered Oct 30 '25 06:10

GregGalloway