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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

remove specific row in calculation

hello everyone i have a table

 

Name    Shift             Hour
AWorktime8
AWorktime9
AWorktime10
AWorktime11
ABreak11
ABreak12
AWorktime12
AWorktime13
AMeeting13
AMeeting14
AMeeting15

 

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 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

 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]))

View solution in original post

1 REPLY 1
Anonymous
Not applicable

 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]))

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.