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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
youngjae
Regular Visitor

I have timestamp and userid. how do I get number of users for each day?

Hi.

 

When I only have UserId(integer) and Timestamp (DateTime), I would like to list up data as below;

 

Source

UserId...Timestamp
1.............12/1/2016 5:33 AM

23...........12/1/2016 7:33 AM
76...........12/8/2016 5:13 AM

23...........12/4/2016 5:13 AM

 

 

Expected Result

DaysOfUse....NumberOfUser

2 days.............2 users

3 days.............1 users

8 days...........11 users

 

 

I read several posts [1],[2] but I do not have start/end duration.

After creating Date column as below, but what can I do next?

 

Date = Source[Timestamp].[Date]

 

1 ACCEPTED SOLUTION

The easiest thing to probably do is to import your source again, but only your UserId field and remove duplicates. Relate this to your fact table. In this new UserId table, create a new column like so:

 

DaysUsed = CONCATENATE(CALCULATE(COUNTROWS(Source))," days")

Source is your source table name.

 

Then just put DaysUsed into a table visulization along with a count of UserId and you should have what you want.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
Greg_Deckler
Community Champion
Community Champion

I am having trouble understanding how your Expected Result relates to your Source data. In your Source data, you have UserId's of 1, 23, 76 and then 23 again. But in your Expected Results, you have "DateOfUsage" and you seem to be using the UserId's there, was that intentional and if so, I'm confused. Please elaborate/clarify. Thanks.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Sorry. I editted upon your request.

 

What I try to do is to get such clause; "11 users use our service 8 (separate) dates"

The easiest thing to probably do is to import your source again, but only your UserId field and remove duplicates. Relate this to your fact table. In this new UserId table, create a new column like so:

 

DaysUsed = CONCATENATE(CALCULATE(COUNTROWS(Source))," days")

Source is your source table name.

 

Then just put DaysUsed into a table visulization along with a count of UserId and you should have what you want.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thanks. wow you are really genius Smiley Happy

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

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

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.