cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

## OVERTIME

Good morning

I'm doing internships at a mechanical services company, and I'm using Power BI to analyze the hours worked per mecáncio, and the overtime they do. To calculate this last I have created a very simple calculated field, since I do not have much knowledge of DAX, and the calculated field is this: EX = SUM(Parts[Hours]) - (8)

The visual I have right now is this, where I've applied different rules so that only overtime is highlighted in red, and in yellow they appear on Saturdays.

What I want to achieve is to obtain the sum of overtime worked by mechanic and that the design is much cleaner, since when I expand the data by mechanic all the work reports of all the years appear, and not only those corresponding to the selected date range, which makes it very difficult to find where that mechanic has worked every day. I only have this last problem when I add the ex calculated field, because if I only add the hours worked per day, the parts on the basis of which the sum of hours is made appear.

Thank you very much in advance.

1 ACCEPTED SOLUTION
Community Support

I created a simple sample as below:

Then create a measure as below:

``````Measure =
IF (
ISINSCOPE ( 'Table'[Subcategory] ),
'Table'[EX],
SUMX ( VALUES ( 'Table'[Subcategory] ), 'Table'[EX] )
)
``````

And you will see:

For the related .pbix file,pls see attached.

Best Regards,
Kelly

6 REPLIES 6
Community Support

I created a simple sample as below:

Then create a measure as below:

``````Measure =
IF (
ISINSCOPE ( 'Table'[Subcategory] ),
'Table'[EX],
SUMX ( VALUES ( 'Table'[Subcategory] ), 'Table'[EX] )
)
``````

And you will see:

For the related .pbix file,pls see attached.

Best Regards,
Kelly

Thanks a lot!

Community Support

If your issue is solved,could you pls mark the reply as answered to let more people find it?

Best Regards,
Kelly

Super User

Please provide sample data in usable format (not as a picture - maybe insert into a table?) and show the expected outcome.

Super User

Not very clear what your actual question is. Is the slicer column connected to the rest of the data model?

Yes, it is connected. And the questions are how can I get the sum of overtime per worker? with the clearest possible design and what should I do to get only the work parts corresponding to the date range to appear?

Thank you very much for your interest,

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

#### Fabric Community Update - August 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors