Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

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...
  • Anonymous's avatar
    Anonymous
    6 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