Forum Discussion
Anonymous
6 years agoNot applicable
ISINSCOPE query
Hi, Could somebody please help me in finishing my ISINSCOPE command? I need the building name to sum the measure 'Total Bookable Hours' at the end, but it wont accept sum or sumx for the mea...
- Anonymous6 years ago
// Assuming that // 1. There is a Building dimension that stores data about buildings. // 2. There is a Room dimension that stores data about rooms. // 3. There is a proper Calendar in the model. // 3. There is a fact table Bookable Hours that for each day stores the bookable // hours for the relevant combinations of buildings and rooms // for each and every day... // you can write this measure and it'll work correctly without // any ISINSCOPE. // Bear in mind that the filtering from dimensions to the fact table // is one-way. [Bookable Hours] = CALCULATE( SUM( 'Bookable Hours'[Hours] ), LASTDATE( Calendar[Day] ) )Best
D
amitchandak
Super User
6 years agoAnonymous , there some missing items you have to fill
Hierarchy = SWITCH(
TRUE(),
ISINSCOPE(
vw1[Room]), [Total Bookable Hours],
ISINSCOPE(
vw1[Building Name]), [?], [?]
)
refer:https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/
- Anonymous6 years agoNot applicable
Hi amitchandak ,
Thanks for your reply. Yes I'm a bit confused as to what to put where the questions marks are.
In all of the examples I have seen with isinscope there has been a sum or divide after the isinscope i.e.
ISINSCOPE(
vw1[Room]), SUM(example),
However, mine already has a measure in place of the sum as below.
ISINSCOPE(
vw1[Room]), [Total Bookable Hours],
When I copy the measure into the second isinscope for the building name, this does not give the desired outcome.