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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
BogdanVlad
Regular Visitor

Help with data shaping/validation

Hello guys,


I'm relatively new to PowerBi and I'm a little stuck.
I have an excel with raw data that contains data about users who acessed a tool:

Usernamee-mailtitledepartmentlog in timelog out time
johndjohnd@example.comend userQuality Assurance2024-01-16 06:40:322024-01-16 06:49:47
ericaserica.s@example.commanagerTransformation2023-07-17 10:53:05 
johndjohnd@example.comadminDigitalization2023-08-04 04:22:522023-08-04 04:23:49
jimbjim.b@example.comend userQuality Assurance2024-03-08 14:28:06 
marksmarks@example.comuserMarketing2024-03-11 07:40:32 
ericaserica.s@example.commanagerTransformation2024-03-11 09:42:142024-03-11 09:49:10
johndjohnd@example.comadminDigitalization2024-03-11 11:15:07 

 

I need to take this into PowerBi and create a report that:

- will show how many times a user accessed the tool.
- create a visual showing how many users have accesed the tool each day, across each month.

- (optional) how much did they spent in the tool.

For the visuals, except the last one, I think I can manage to built them, but I'm stuck with the first requirement.
Apologies if this does not make sense, let me know if you need more info!

Thank you!

BV

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @BogdanVlad 

 

Your solution is great, @ray_aramburo. It worked like a charm! Here I have another idea in mind, and I would like to share it for reference.

 

For your first and third questions, you can also do this:

 

First:

Create a measure as follows

times = CALCULATE(COUNT('Table'[Username]), ALLEXCEPT('Table', 'Table'[Username]))

 

Result:

vxuxinyimsft_0-1712026253044.png

 

Third:

Create a measure as follows

spent = 
VAR _total = DATEDIFF(MAX([log in time]), MAX([log out time]), MINUTE) * 60
VAR _hours = QUOTIENT(_total, 3600)
VAR _minutes = QUOTIENT(MOD(_total, 3600), 60)
RETURN
IF(MAX([log out time]) <> BLANK(), FORMAT(_hours, "[h]") & ":" & FORMAT(_minutes, "[m]"), BLANK())

 

Result:

vxuxinyimsft_4-1712026334457.png

To make this formula more obvious, so I added a line of data "a".

 

Best Regards,
Yulia Xu

 

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

2 REPLIES 2
Anonymous
Not applicable

Hi @BogdanVlad 

 

Your solution is great, @ray_aramburo. It worked like a charm! Here I have another idea in mind, and I would like to share it for reference.

 

For your first and third questions, you can also do this:

 

First:

Create a measure as follows

times = CALCULATE(COUNT('Table'[Username]), ALLEXCEPT('Table', 'Table'[Username]))

 

Result:

vxuxinyimsft_0-1712026253044.png

 

Third:

Create a measure as follows

spent = 
VAR _total = DATEDIFF(MAX([log in time]), MAX([log out time]), MINUTE) * 60
VAR _hours = QUOTIENT(_total, 3600)
VAR _minutes = QUOTIENT(MOD(_total, 3600), 60)
RETURN
IF(MAX([log out time]) <> BLANK(), FORMAT(_hours, "[h]") & ":" & FORMAT(_minutes, "[m]"), BLANK())

 

Result:

vxuxinyimsft_4-1712026334457.png

To make this formula more obvious, so I added a line of data "a".

 

Best Regards,
Yulia Xu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

ray_aramburo
Super User
Super User

Hi, you can drag the UserName column into a Values column (Y-axis for example) and automatically, since its a Text type column, Power BI will set it up as Count Of UserName and then changing it to Distinct Count in the field options:

ray_aramburo_0-1711985148961.png

 

This will give you a general view of the number of users per month, if you want a detailed view per user you would need to modify the Distinct Count to a Standard Count and add Username to the Legend field. 

I have created those examples with the dummy data you provided. Check the attached file.





Did I answer your question? Give your kudos and mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.