cancel
Showing results for 
Search instead for 
Did you mean: 
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
Solution Sage
Solution Sage

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
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors