Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

switch depending on the slicer selection

Hi all, I have two measure: [CompanyTarget] [SiteTarget] And one slicer: "Sellect All" / "Site 1" / "Site2" /... / "Site8"   I would like to swich from [CompanyTarget] to [SiteTarget], dependi...
  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi Anonymous ,

    I fixed my formula and your measures, then it can work with both single and multiple selections:

     

    Site Target =
    SELECTEDVALUE ( Targets[Water], SUM ( Targets[Water] ) )
    
    Company Target =
    CALCULATE (
        SUM ( Targets[Water] ),
        FILTER ( ALL ( Targets ), Targets[Site Code] = 99 )
    )
    
    Measure = 
    SWITCH (
        ISFILTERED( Tabla[Site Name] ),
        TRUE (), [Site Target],
        FALSE (), [Company Target]
    )
    

     

    Regards,

    Xiaoxin Sheng