Forum Discussion
How to get the Current Unique users per day?
Hi All,
I want to cont the unique users againt the date.
By executing the SQL query i can get the result as below,
I want to display in the Measure Unique users count which is latest available in the tabel name 'data'. So 86 i have to display in the screen instead of 1 as shown in the image above.
table: data
columnname: servertime --- Datatype = Date/time
columnname: user --- Datatype = Whole number
- Anonymous2 years ago
Hi ssspk ,
Thanks for the reply from selimovd .
Your solution is great, marcosvin . It worked like a charm! Here I have another idea in mind, and I would like to share it for reference.
Please try:
Create a measure:
Latest Users = VAR _LatestDate = CALCULATE( MAX('data'[Date]), ALL('data') ) RETURN LOOKUPVALUE('data'[Unique_Users], 'data'[Date], _LatestDate)In the final page the effect is shown below:
The pbix file is attached.
If you have any other questions please feel free to contact me.
Best Regards,
Yang
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
3 Replies
- AnonymousNot applicable
Hi ssspk ,
Thanks for the reply from selimovd .
Your solution is great, marcosvin . It worked like a charm! Here I have another idea in mind, and I would like to share it for reference.
Please try:
Create a measure:
Latest Users = VAR _LatestDate = CALCULATE( MAX('data'[Date]), ALL('data') ) RETURN LOOKUPVALUE('data'[Unique_Users], 'data'[Date], _LatestDate)In the final page the effect is shown below:
The pbix file is attached.
If you have any other questions please feel free to contact me.
Best Regards,
Yang
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot! - marcosvin
Resolver II
Hello!
As your "traces" table is already showing the values ​​calculated in the SQL query, a DAX formula that could work would be the following:
UniqueUsersLastDate = CALCULATE(MAX(TableName[Unique_Users]),LASTDATE(TableName[Date]))
If your SQL query brings all the rows from the "traces" table (instead of COUNT) then you could use "DISTINCTCOUNT" instead of "MAX" in the formula above.