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
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!
User | Count |
---|---|
119 | |
75 | |
66 | |
51 | |
49 |
User | Count |
---|---|
180 | |
96 | |
79 | |
77 | |
74 |