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.
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 🙂
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
98 | |
78 | |
66 | |
53 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |