Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

SWITCH and ISFILTERED combination

Hi all I am using a measure as follows:   Fixed cost var filters = SWITCH( TRUE(), ISFILTERED(dDate[Year]), DIVIDE( CALCULATE( SUM('Fixed Cost per Month'[fixed Co...
  • Anonymous's avatar
    Anonymous
    6 years ago

    Using INSCOPE instead of ISFILTER does the job

    Fixed cost var filters = 
    SWITCH(
        TRUE(),
        ISINSCOPE(dDate[Year]),
        DIVIDE(
            CALCULATE(
                SUM('Fixed Cost per Month'[fixed Cost]),
                ALL('Fixed Cost per Month'[fixed Cost])
            )
            *MAX(dDate[Month Number]),
            [Dedicated Shipments]
        ),
            ISINSCOPE(dDate[Month]),
          DIVIDE(
             SUM('Fixed Cost per Month'[fixed Cost]),
                [Dedicated Shipments]
            ),
            ISINSCOPE('Prototype Modeling_Freight'[Plant Cluster]),
            DIVIDE(
                SUM('Fixed Cost per Month'[fixed Cost]),
                [Dedicated Shipments]  
    
                    ),
                    ISINSCOPE('Equipment Master'[Max Loadability in Tonns]),
                    
                    DIVIDE(VALUES('Fixed Cost per Month'[fixed Cost]),[Dedicated Shipments]),BLANK()
        )