Forum Discussion
Help with data shaping/validation
- Anonymous2 years ago
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:
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:
To make this formula more obvious, so I added a line of data "a".
Best Regards,
Yulia XuIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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:
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:
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.