Forum Discussion
Countdistinct not working (headcount style)
Hi guys,
I'm having issues to calculate count distinct properly.
I have to count number of doctors per month (like a headcount) and I need to count them per number of invoice.
I'm doing distinct count on the number of invoices but it doesn't seem to be working.
Number of Doctors =
How do I achieve this?
Hi Anonymous ,
Try to create a measure like this:
Number of Doctors = CALCULATE( DISTINCTCOUNT('fac'table[invoiceno]),ALLEXPECT('fac'table,'fac'table[MONTH])If the problem persists,could you share the sample pbix via cloud service like onedrive for business?
Please remove any sensitive data before uploading.
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- Ashish_MathurSuper User
Hi,
You do not need a CALCULATE() function there. Share some data and show the expected result.
- V-lianl-msftCommunity Support
Hi Anonymous ,
Try to create a measure like this:
Number of Doctors = CALCULATE( DISTINCTCOUNT('fac'table[invoiceno]),ALLEXPECT('fac'table,'fac'table[MONTH])If the problem persists,could you share the sample pbix via cloud service like onedrive for business?
Please remove any sensitive data before uploading.
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.