Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi Everyone,
I'm having a problem working out how to do the following, I'm not sure if it's something I'll need to do at the data level or if a measure can do it.
I have data setup like the following:
Organisation | ServiceName | Availability | Capacity | Service
|
Club A | Club Athletics | 0 | 24 | Archery
|
Club A | Club Athletics | 0 | 24 | Swimming |
Club A | Club Athletics | 0 | 24 | Tennis |
Club A | Club Athletics | 0 | 24 | Basketball |
Tennis Club | Wimbledon | 1 | 36 | Tennis |
Tennis Club | Wimbledon | 1 | 36 | Squash |
Diving School | Swimming Pool Lane | 0 | 13 | Swimming |
Football Camp | Nou Camp | 0 | 16 | Football |
Driving School | Paris | 3 | 57 | F1 |
Driving School | Paris | 3 | 57 | F2 |
Driving School | Berlin | 7 | 41 | F1 |
Driving School | Berlin | 7 | 41 | F2 |
Driving School | Milan | 6 | 35 | F1 |
Driving School | Chicago | 2 | 52 | F1 |
The result I am trying to return in a matrix is grouped by Organisation Name, then service name and then service. The problem I have got is that there are multiple lines for each provider relating to capacity, so for example, Driving school Berlin has 41 places overall which can be filled with either F1 or F2, not 82 places which is how it would be summed. I've tried writing a max measure which works at a servicename level, but then at organisation level it just returns the max value of services so for driving school 57 is returned when i want it to be 185.
The above would be summed as follows:
Club A capacity 24 | ||||
Tennis Club capacity 36 | ||||
Diving School capacity 13 | ||||
Football Camp capacity 16 | ||||
Driving School Capacity 185 | Paris 57 | Berlin 41 | Milan 35 | Chicago 52 |
This is the measure i currently have:
Max Capacity =
CALCULATE (
MAX(‘table'[Capacity]),
FILTER (
ALLEXCEPT ( ‘table', ‘table'[Organisation] ),
‘table’[Capacity] = MAX ( ‘table’[Capacity])
)
)
Any help or pointers would be great as I'm going round in circles.
thanks in advance
Solved! Go to Solution.
@ConfusedTime Try this:
Measure =
VAR __Table = SUMMARIZE('Table', [Organisation], [ServiceName], "__Capacity", AVERAGE('Table'[Capacity]) )
VAR __Result = SUMX(__Table, [__Capacity])
RETURN
__Result
Thank you so much!!! This works perfectly! 🙂
@ConfusedTime Try this:
Measure =
VAR __Table = SUMMARIZE('Table', [Organisation], [ServiceName], "__Capacity", AVERAGE('Table'[Capacity]) )
VAR __Result = SUMX(__Table, [__Capacity])
RETURN
__Result
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
26 | |
20 | |
19 | |
14 | |
13 |
User | Count |
---|---|
43 | |
36 | |
24 | |
23 | |
22 |