Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
mmills2018
Helper IV
Helper IV

ISINTOTAL not working

Hello,

 

I have a hierarchy based on Platform and Group.  Group is the lowest level of the hierarchy.  I need to bring in static data for my goals, when i bring this data in, my matrix table is adding the subtotals.  So, my subtotals are at the platform level.  I tried using ISINSCOPE to customize my subtotals, but for some reason i can't get it to work.  below is my measure and data.  any ideas what i am doing wrong?

 

measure:

var _group = ISINSCOPE(Sheet1[Group])
var _groupsum = sum(Sheet1[Goal])
var platform = ISINSCOPE(Sheet1[Platform])
var platformsum = CALCULATE(sum(Sheet1[Goal]),Sheet1[IsPlatform]=1)
return
SWITCH(TRUE(),_group,_groupsum,platform,platformsum)

 

Data:

 

PlatformGroupGoalMgmt LevelsIsPlatform
Platform 1 1.1Group Total1
Platform 1 2.1Total PME1
Platform 1 3.1M4+1
Platform 1 4.1M1-M31
Platform 1 5.1P1-P61
Platform 1 6.1O1-O41
Platform 1 7.1B1-B41
Platform 1 8.1T1-T41
Platform 1Group 18.1Group Total0
Platform 1Group 18.1Total PME0
Platform 1Group 18.1M4+0
Platform 1Group 18.1M1-M30
Platform 1Group 18.1P1-P60
Platform 1Group 18.1O1-O40
Platform 1Group 18.1B1-B40
Platform 1Group 18.1T1-T40
Platform 1Group 20.1Total PME0
Platform 1Group 22.1M4+0
Platform 1Group 23.1M1-M30
Platform 1Group 24.1P1-P60
Platform 1Group 25.1O1-O40
Platform 1Group 26.1B1-B40
Platform 1Group 27.1T1-T40
Platform 2 8.1Total PME1
Platform 2 10.1M4+1
Platform 2 11.1M1-M31
Platform 2 12.1P1-P61
Platform 2 13.1O1-O41
Platform 2 14.1B1-B41
Platform 2 15.1T1-T41
Platform 2Group 38.1Total PME0
Platform 2Group 310.1M4+0
Platform 2Group 311.1M1-M30
Platform 2Group 312.1P1-P60
Platform 2Group 313.1O1-O40
Platform 2Group 314.1B1-B40
Platform 2Group 315.1T1-T40
1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @mmills2018 ,

 

What is the expected result for this calculation how is the sub-totals expected to be calculated.

 

Lookking at your data you need to pick up all the value for the platform, since you are using the inscope for both the values believe that the error you are getting in on the total line correct that is not returning any value for this you can simple use the measure below:

 

measure = var _group = ISINSCOPE(Sheet1[Group])
var _groupsum = sum(Sheet1[Goal])
var platform = ISINSCOPE(Sheet1[Platform])
var platformsum = CALCULATE(sum(Sheet1[Goal]),Sheet1[IsPlatform]=1)
return
SWITCH(TRUE(),_group,_groupsum,platformsum)

 

MFelix_0-1616079923182.png

 

 

However I have some doubts about your syntax since when making the hierarchy like you have you get a value with blanks(line highlithed) so when you filter that out your calculation get's incorrect you can remake you measure to:

oupsum = sum(Sheet1[Goal])
var platform = ISINSCOPE(Sheet1[Platform])
var platformsum = CALCULATE(sum(Sheet1[Goal]),FILTER(ALL(sheet1),Sheet1[IsPlatform]=1 && sheet1[Platform] in VALUES(sheet1[Platform])))
return
SWITCH(TRUE(),_group,_groupsum,platformsum)

 

This will allow to filter out the blanks and get the correct resutls:

MFelix_1-1616080115035.png

Another option can go to having dimension tables for the platforms and groups with the objectives on those tables but that implies big changes in your model.

 

Check PBIX file attach.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português





View solution in original post

1 REPLY 1
MFelix
Super User
Super User

Hi @mmills2018 ,

 

What is the expected result for this calculation how is the sub-totals expected to be calculated.

 

Lookking at your data you need to pick up all the value for the platform, since you are using the inscope for both the values believe that the error you are getting in on the total line correct that is not returning any value for this you can simple use the measure below:

 

measure = var _group = ISINSCOPE(Sheet1[Group])
var _groupsum = sum(Sheet1[Goal])
var platform = ISINSCOPE(Sheet1[Platform])
var platformsum = CALCULATE(sum(Sheet1[Goal]),Sheet1[IsPlatform]=1)
return
SWITCH(TRUE(),_group,_groupsum,platformsum)

 

MFelix_0-1616079923182.png

 

 

However I have some doubts about your syntax since when making the hierarchy like you have you get a value with blanks(line highlithed) so when you filter that out your calculation get's incorrect you can remake you measure to:

oupsum = sum(Sheet1[Goal])
var platform = ISINSCOPE(Sheet1[Platform])
var platformsum = CALCULATE(sum(Sheet1[Goal]),FILTER(ALL(sheet1),Sheet1[IsPlatform]=1 && sheet1[Platform] in VALUES(sheet1[Platform])))
return
SWITCH(TRUE(),_group,_groupsum,platformsum)

 

This will allow to filter out the blanks and get the correct resutls:

MFelix_1-1616080115035.png

Another option can go to having dimension tables for the platforms and groups with the objectives on those tables but that implies big changes in your model.

 

Check PBIX file attach.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português





Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.