Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
ssspk
Helper III
Helper III

How to get the Current Unique users per day?

Hi All,

 

I want to cont the unique users againt the date.

u_users_1.png

 

By executing the SQL query i can get the result as below,

u_users_2.png

 

 

 

 

 

 

 

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

 

SELECT to_date(servertime,'yyyy-MM-dd') as Date, COUNT(DISTINCT user) as Unique_Users
FROM traces.data
INNER JOIN traces.type ON data.type = type.id
GROUP BY to_date(servertime,'yyyy-MM-dd')
ORDER BY 1 DESC;
 
Here default mapping is available in BI(no need to worry about inner join). How to create a DAX for this Query?
 
Thanks and Regards,
Siva
1 ACCEPTED SOLUTION
Anonymous
Not 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:

vhuijieymsft_0-1716864046956.png

 

The pbix file is attached.

 

If you have any other questions please feel free to contact me.

 

Best Regards,
Yang
Community Support Team

 

If 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!

View solution in original post

3 REPLIES 3
Anonymous
Not 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:

vhuijieymsft_0-1716864046956.png

 

The pbix file is attached.

 

If you have any other questions please feel free to contact me.

 

Best Regards,
Yang
Community Support Team

 

If 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
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.

selimovd
Super User
Super User

Hey @ssspk ,

 

can you create a sample file?

Otherwise there are too many unknown factors.

 

Thank you and best regards

Denis

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors