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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Syndicate_Admin
Administrator
Administrator

Maximum hours of activities

Hello friends. How are you?. I'm already having a headache trying to fix a problem in power bi. I have dealt with tables, formulas and I do not succeed. I need to know the maximum of a set of shifts according to dates. Here is an example:

DateShiftEmployees
28-mar-2023A12
28-mar-2023A10
28-mar-2023B8
28-mar-2023B6
29-mar-2023A4
29-mar-2023B2
30-mar-2023A5
30-mar-2023A7
30-mar-2023B6

And the solution I need from maximums is:

DateShiftEmployees
28-mar-2023A12
28-mar-2023B8
29-mar-2023A4
29-mar-2023B2
30-mar-2023A7
30-mar-2023B6

I hope that is understood. Thank you very much and hug

Sergio

4 REPLIES 4
Syndicate_Admin
Administrator
Administrator

Thanks, I couldn't find the PBIX, what is the name?

final

final.pbix

TomMartens
Super User
Super User

Hey @Syndicate_Admin ,

here is a more simple solution. The most simple solution is to use implicit measures, meaning to change the aggregation function from SUM (the default function for numeric columns) to MAX:
image.png

  1. Open the context menu (right click) 
  2. Select the aggregation function you want

The default aggregation function can be changed in the Power BI dataset, or you can change the aggregation function per visual, of course, it's possible to mix both settings as needed.

The DAX statement below is the simplest to calculate a measure returning the MAX value. Measures are considered explicit measures, whereas changing the aggregation function creates implicit measures:

 

Employees (MAX) = 
CALCULATE( MAX( 'Table'[Employees] ) ) 

 

If your users can access your Power BI dataset with "Analyze in Excel," then you need explicit measures.

 

Hopefully, this helps to tackle your challenge.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Ahmedx
Super User
Super User

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
https://1drv.ms/f/s!AiUZ0Ws7G26RhgCvMt2xlt4fkBtc?e=r5U9I2
Screen Capture #771.pngScreen Capture #772.png

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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