Forum Discussion
Function to count one login value per day
- 8 years ago
The distinctcount will give you the result you are looking for as a measure rather than a field. You could bring the user count through onto a bar chart with date on the xaxis and then change the summarisation on the values field to a distinct count. That would also work. If you are certain you want the count on the individual row level you would need to do a =CALCULATE(DISTINCTCOUNT(Table[USERID]),ALLEXCEPT(Table,Table[Date],Table,[UserID])) that would give you a field that when bought through would give you the samne result, but would show a 1 on each of the rows if you looked at the table.
// If this is a solution please mark as such
Hello, maybe try this measure
=DISTINCTCOUNT(Table[USERID])
you can then slice and dice by day or what ever you need.
// If this is a solution please mark as such
Thank you for your reply!
Unfortunately, this doesn't seem to be what I was looking for. Effectively, what I would like to do, is add a column onto my systemusers table that will count how many days a user has logged in, and only count one login for a given day. I've been trying to see if I can come up with a fuction to do this, but I am not having much luck. Not sure if this is even possible or not...
- samdthompson8 years ago
Memorable Member
The distinctcount will give you the result you are looking for as a measure rather than a field. You could bring the user count through onto a bar chart with date on the xaxis and then change the summarisation on the values field to a distinct count. That would also work. If you are certain you want the count on the individual row level you would need to do a =CALCULATE(DISTINCTCOUNT(Table[USERID]),ALLEXCEPT(Table,Table[Date],Table,[UserID])) that would give you a field that when bought through would give you the samne result, but would show a 1 on each of the rows if you looked at the table.
// If this is a solution please mark as such
- jsnyce8 years agoRegular Visitor
Now I understand what you meant before, I apologize! Both of those are great options. I will have to try both and see which works better. Thank you very much for your help and quick responses!!!!
- samdthompson8 years ago
Memorable Member
No worries mate, its often to get so consumed by the model that its hard to find a way.