Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I have my data in the following format:
I need my visual in the following format. I already have measures defined for total hours worked per day, I'm just having a bit of trouble with the number of days worked.
Thanks a lot.
Solved! Go to Solution.
hi @amalm
If so, create two measure as below:
Fulldays =
var _table= SUMMARIZE('Table','Table'[username],'Table'[date],"hours",CALCULATE(SUMX('Table',DATEDIFF('Table'[start time],'Table'[end time],MINUTE)))/60)
return
COUNTAX(FILTER(_table,[hours]>=6),[date])
Halfdays =
var _table= SUMMARIZE('Table','Table'[username],'Table'[date],"hours",CALCULATE(SUMX('Table',DATEDIFF('Table'[start time],'Table'[end time],MINUTE)))/60)
return
COUNTAX(FILTER(_table,[hours]<6),[date])
Regards,
Lin
hi @amalm
If there is a working time limit to determine if it's a worked day?
If not, Just create a measure as below:
Measure = DISTINCTCOUNT(Table[Date])
if yes, please share the logic of it.
Regards,
Lin
Thank you, what if I want to have 2 measures Fulldays and Halfdays where anything less than total 6 hours is considered a half day?
hi @amalm
If so, create two measure as below:
Fulldays =
var _table= SUMMARIZE('Table','Table'[username],'Table'[date],"hours",CALCULATE(SUMX('Table',DATEDIFF('Table'[start time],'Table'[end time],MINUTE)))/60)
return
COUNTAX(FILTER(_table,[hours]>=6),[date])
Halfdays =
var _table= SUMMARIZE('Table','Table'[username],'Table'[date],"hours",CALCULATE(SUMX('Table',DATEDIFF('Table'[start time],'Table'[end time],MINUTE)))/60)
return
COUNTAX(FILTER(_table,[hours]<6),[date])
Regards,
Lin
@amalm , what is role of time for this.
You can use a measure distinctcount(Table[Date])
If there is no additional logic for considering a date as a working day, you can calculate the distinct count of the date column.
Example
Username | date |
user1 | 12 April 2020 |
user1 | 12 April 2020 |
user2 | 12 April 2020 |
user2 | 12 April 2020 |
user3 | 12 April 2020 |
user1 | 13 April 2020 |
Measure = DISTINCTCOUNT(MyTable[date])
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂
User | Count |
---|---|
141 | |
113 | |
104 | |
78 | |
64 |
User | Count |
---|---|
136 | |
125 | |
107 | |
70 | |
61 |