Forum Discussion

mmills2018's avatar
mmills2018
Helper IV
5 years ago
Solved

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 add...
  • MFelix's avatar
    5 years ago

    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)

     

     

     

    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:

    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.