Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have data that shows Location, shift, and weekday, and customer ID.
What I am trying to accomplish is finding the maximum number of customers on any day and any shift to determine the maximum customer limit at a location.
So I can say on any shift and on any day this location can hold x amount of customers. In the example below the max would be 3 at location A. If I can do this in a Measure that would be preferred. Any help is greatly appreciated.
My data looks like below:
Location | Shift | Weekday | Customer ID | Max (Desired Output) |
A | 1 | Monday | 1 | 3 |
A | 1 | Monday | 2 | 3 |
A | 1 | Monday | 3 | 3 |
A | 1 | Tuesday | 4 | 3 |
A | 2 | Monday | 5 | 3 |
A | 2 | Tuesday | 6 | 3 |
A | 2 | Tuesday | 7 | 3 |
Solved! Go to Solution.
This version should be simpler and more efficient:
MaxCustomers =
MAXX (
SUMMARIZE (
CALCULATETABLE ( Data, ALLEXCEPT ( Data, Data[Location] ) ),
Data[Location],
Data[Shift],
Data[Weekday],
"@Count", COUNT ( Data[Customer ID] )
),
[@Count]
)
This should work as a measure or a calculated column.
This version should be simpler and more efficient:
MaxCustomers =
MAXX (
SUMMARIZE (
CALCULATETABLE ( Data, ALLEXCEPT ( Data, Data[Location] ) ),
Data[Location],
Data[Shift],
Data[Weekday],
"@Count", COUNT ( Data[Customer ID] )
),
[@Count]
)
This should work as a measure or a calculated column.
Hi,
Please check the below picture and the attached pbix file.
MAX desired output: =
This looks like it works, but my table has ~500k rows. Doesn't look like its optimal for this. Any other thoughts or suggestions?
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
67 | |
57 | |
54 | |
36 | |
34 |
User | Count |
---|---|
84 | |
71 | |
55 | |
45 | |
43 |