Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
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:
Date | Shift | Employees |
28-mar-2023 | A | 12 |
28-mar-2023 | A | 10 |
28-mar-2023 | B | 8 |
28-mar-2023 | B | 6 |
29-mar-2023 | A | 4 |
29-mar-2023 | B | 2 |
30-mar-2023 | A | 5 |
30-mar-2023 | A | 7 |
30-mar-2023 | B | 6 |
And the solution I need from maximums is:
Date | Shift | Employees |
28-mar-2023 | A | 12 |
28-mar-2023 | B | 8 |
29-mar-2023 | A | 4 |
29-mar-2023 | B | 2 |
30-mar-2023 | A | 7 |
30-mar-2023 | B | 6 |
I hope that is understood. Thank you very much and hug
Sergio
Thanks, I couldn't find the PBIX, what is the name?
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:
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
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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
116 | |
82 | |
47 | |
42 | |
31 |
User | Count |
---|---|
186 | |
80 | |
72 | |
48 | |
45 |