Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
I have leave types listed in rows. One row per month, per person per leave type. The calculation is based on a person's availability. The per person availability is set at the difference between the number of time in a month (173) minus the amount of vacation they spent in that month (e.g 173 - 6 days of vacation would be 167 of availability for that month).
The monthly availability should be the SUM(of the invididual's availability) - the sum of their non vacation leave types.
E.g. in Feb, James took 4 days of vacation leave which brings him to a potential availability of 169.
I need a way of suming the availability of all persons in a month while having 2 records per person, with each record having the same value (e.g. 173, 169 etc). I can't use average because then the month will end up as an average of all the records; which is what I don't want.
Solved! Go to Solution.
@slewis I think the issue is you want to aggregate it differently depending on the scope. You can do that by using the ISINSCOPE dax statement:
https://docs.microsoft.com/en-us/dax/isinscope-function-dax#syntax
Difference = sumx('Table','Table'[Availability]-'Table'[Total])
Difference ISINSCOPE =
switch(
true(),
isblank( SELECTEDVALUE( 'Table'[Month] ) ),
sumx(
values( 'Table'[Month] ),
sumx(
values( 'Table'[Person] ),
CALCULATE( minx( values( 'Table'[Leave Type] ), [Difference] ) )
)
),
isinscope( 'Table'[Month] ),
sumx(
values( 'Table'[Person] ),
CALCULATE( minx( values( 'Table'[Leave Type] ), [Difference] ) )
),
ISINSCOPE( 'Table'[Person] ),
minx( values( 'Table'[Leave Type] ), [Difference] ),
[Difference]
)
What this does is a series of checks to and then provide a different aggregation:
Respectfully,
Zoe Douglas (DataZoe)
Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/
IsInScope was too difficult to use, and apparently, very compute-intensive. I used Summerize instead.
That's awesome @slewis ! Can you share what you did so that it may help someone else out that also has this issue?
Respectfully,
Zoe Douglas (DataZoe)
Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/
@slewis I think the issue is you want to aggregate it differently depending on the scope. You can do that by using the ISINSCOPE dax statement:
https://docs.microsoft.com/en-us/dax/isinscope-function-dax#syntax
Difference = sumx('Table','Table'[Availability]-'Table'[Total])
Difference ISINSCOPE =
switch(
true(),
isblank( SELECTEDVALUE( 'Table'[Month] ) ),
sumx(
values( 'Table'[Month] ),
sumx(
values( 'Table'[Person] ),
CALCULATE( minx( values( 'Table'[Leave Type] ), [Difference] ) )
)
),
isinscope( 'Table'[Month] ),
sumx(
values( 'Table'[Person] ),
CALCULATE( minx( values( 'Table'[Leave Type] ), [Difference] ) )
),
ISINSCOPE( 'Table'[Person] ),
minx( values( 'Table'[Leave Type] ), [Difference] ),
[Difference]
)
What this does is a series of checks to and then provide a different aggregation:
Respectfully,
Zoe Douglas (DataZoe)
Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 64 | |
| 51 | |
| 46 | |
| 23 | |
| 19 |
| User | Count |
|---|---|
| 136 | |
| 110 | |
| 50 | |
| 32 | |
| 29 |