Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
hello everyone i have a table
Name | Shift | Hour |
A | Worktime | 8 |
A | Worktime | 9 |
A | Worktime | 10 |
A | Worktime | 11 |
A | Break | 11 |
A | Break | 12 |
A | Worktime | 12 |
A | Worktime | 13 |
A | Meeting | 13 |
A | Meeting | 14 |
A | Meeting | 15 |
calculate ccount of work hours and count of non working
i use calculate(count(table[name]),filter(table,table[shift] = "Worktime")) and
calculate(count(table[name]),filter(table,table[shift] <> "Worktime"))
now i have worktime count is 6 and non worktime is 5, but this is wrong ,
as you see, worktime and break overlapp each others,so how can i make it that max of first breaktime which is12 to not be taken into consideration and max of meeting also so that way i have 1 count of break and 2 count of meeting
Solved! Go to Solution.
I just created a new calculated column that find the max value filtered by name
Maxnonworking = CALCULATE(MAX(table[Hour]),FILTER(ALLEXCEPT(table,Roster[Name]),table[shift]<>"Worktime"))
then for the nonavailable shift just create a new measure:
not availibile = CALCULATE(COUNT(table[Name]),FILTER(table,table[Shift] <> "Worktime"),FILTER(table,table[Hour]<>table[Maxnonworking]))
I just created a new calculated column that find the max value filtered by name
Maxnonworking = CALCULATE(MAX(table[Hour]),FILTER(ALLEXCEPT(table,Roster[Name]),table[shift]<>"Worktime"))
then for the nonavailable shift just create a new measure:
not availibile = CALCULATE(COUNT(table[Name]),FILTER(table,table[Shift] <> "Worktime"),FILTER(table,table[Hour]<>table[Maxnonworking]))
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
6 | |
5 |
User | Count |
---|---|
20 | |
14 | |
10 | |
9 | |
6 |