Forum Discussion
DAX Calculation unique Count
- 8 years ago
Try this one
Measure = COUNTX ( FILTER ( SUMMARIZE ( ALLSELECTED ( TableName ), TableName[Phone Number], TableName[Invoice Date] ), [Fraud or Valid] = "Fraud" ), 1 )
I'm not sure I am following this, so are you saying that you only want the 123456 phone number counted once as a fraud instead of multiple times? If that is the case, then perhaps you could take the DISTINCTCOUNT of your phone numbers and subtract that from your COUNT of phone numbers and that would give you how many duplicates you have and then just subtract that from your fraud count?
- Sean8 years agoCommunity Champion
This Measure should work!
Fraud Number = CALCULATE ( DISTINCTCOUNT ( CustomerInvoice[Phone Number] ), FILTER ( CustomerInvoice, [Fraud or Valid] = "Fraud" ) )Good Luck! :smileyhappy:
- Sidhartha_19928 years agoNew Member
No,Sir i want the phone number 123456 to be counted as two.
The solution you provided gets me the distinct count of FRAUD numbers but i want the overall count of FRAUD numbers which should be 4 for the table provided above but your formula is giving the count as 3
- Zubair_Muhammad8 years agoCommunity Champion
Try this one
Measure = COUNTX ( FILTER ( SUMMARIZE ( ALLSELECTED ( TableName ), TableName[Phone Number], TableName[Invoice Date] ), [Fraud or Valid] = "Fraud" ), 1 )- Sidhartha_19928 years agoNew Member
Thanks a lot Zubair,it worked for me :)