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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
roosechua
Frequent Visitor

Counting data per day if data rows are date/time format

Hi, I am just starting to use Power BI and currently, I am trying to generate a graph of user logins. My data sample looks like:

 

ServerDateUser
ServerA10/9/2019 12:24User A
ServerA10/9/2019 14:16User A
ServerA10/11/2019 8:44User B
ServerA10/11/2019 13:54User C
ServerB10/9/2019 14:35User D
ServerA10/18/2019 16:55User B
ServerA10/18/2019 17:41User C
ServerA10/21/2019 12:05User D
ServerB10/24/2019 8:23User C
ServerB10/24/2019 9:30User C
ServerB10/24/2019 13:22User C
ServerB10/24/2019 17:52User C

 

I would like to create a bar graph, based on filtered date, showing how many users logged in per day. I have tried to create a date dimension table and created a relationship with my data table, but I can't seem to just show the graph that I would like to have. Do I need to create a measure to get what I would like to do? Unfortunately, I have not used DAX yet, and hopefully, I will be able to learn that as well in the future. 

 

Hoping somebody can show me how I can do this. TIA!

2 ACCEPTED SOLUTIONS
v-diye-msft
Community Support
Community Support

Hi @roosechua 

 

Could you please let me know if you'd like to get this one?

1. I changed your date/time column as Date in power query:

007.PNG

2. Add the measure :

Measure = CALCULATE(DISTINCTCOUNT(Table1[User]),ALL(Table1),VALUES(Table1[Date]))

3. Create the visual:

008.PNG

 

Pbix attached.

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

View solution in original post

Thanks for the tip! What I did was similar to this, creating a new column with just the date, no timing. I was finally able to achieve what I wanted.

View solution in original post

7 REPLIES 7
v-diye-msft
Community Support
Community Support

Hi @roosechua 

 

Could you please let me know if you'd like to get this one?

1. I changed your date/time column as Date in power query:

007.PNG

2. Add the measure :

Measure = CALCULATE(DISTINCTCOUNT(Table1[User]),ALL(Table1),VALUES(Table1[Date]))

3. Create the visual:

008.PNG

 

Pbix attached.

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

Thanks for the tip! What I did was similar to this, creating a new column with just the date, no timing. I was finally able to achieve what I wanted.

nahid3152
Helper II
Helper II

HI, 
Can u share ur file and a required look in excel 

 

Please check 
https://drive.google.com/file/d/1lfEDPAzvvLrBPKZgfT07WCVsm1L0xDsZ/view?usp=sharing

is it help u?

TIA

Hi @nahid3152,

 

Thanks for sharing some thoughts on this and sharing your sample file. Unfortunately, I am unable to share online files due to org's security policy. However, I am attaching an Excel graph which is what I want to have in Power BI. 

 

The file you shared is not what I was looking for. 

 

My target graphMy target graph

 

Any thoughts on how to do this in Power BI?

Sorry @nahid3152, as there will be hundreds of servers on the official data, I was hoping that I will just be able to create the visual without doing another pivot. I just showed the graph I created in Excel as an example of what I want the end result to be, just using the original data source. Is that possible in Power BI? Or do I need to create a measure to calculate the number of users who logged in per day? Thanks!

Yes, I hope, You can do it in power bi using measure

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.