Forum Discussion
Power BI Measure for Distinct Count
- 3 years ago
Hi , Kavindya
According to your description, do you mean you want to add a column in "Summary" table to calculate the distincount of the [Agent ID] in 'Agent Join' table where Agent_Join.Department_ID = Summary.Department_ID and Agent_Join.Date = Summary.Date?
If this , here are the steps you can refer to :
(1)My test data is the same as yours.(2)We can click "New column" and enter:
No fo Active Agents = var _date = [Date] var _departmentID=[DepartmetnID] var _t =DISTINCT(SELECTCOLUMNS( FILTER('Agent Join','Agent Join'[Department ID]=_departmentID && 'Agent Join'[Date]=_date) , "Agent ID",[Agent ID])) return COUNTROWS(_t)+0Then we can get your need:
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi Kavindya ,
I'm not sure I fully understand the question, but DISTINCTCOUNT is the dax function you can use.
https://learn.microsoft.com/en-us/dax/distinctcount-function-dax