Forum Discussion

Rob_B's avatar
Rob_B
Helper I
6 years ago
Solved

Filter visualizations by measure value AND column value

I need to filter my visualizations by a measure value and a column value. Visual filters appear to only allow filtering the measure by the measure value. In any case, this approach would not be ideal since it would have to be applied to each and every visual.

 

The measure that requires filtering ([Scenario TRC Ratio]) uses the DIVIDE function on two other measures that include what-if parameters. Only the results where Forecast[Activity]<>"B" AND [Scenario TRC Ratio] < 1.0  should be excluded, where:

 

 

Scenario TRC Ratio = DIVIDE([Scenario Benefits]|[Scenario TRC Cost]|0)

 

 

 

Scenario Benefits = SUM(Forecast[Benefits]) * (1+[Parameter1])
Scenario TRC Cost = CALCULATE(
SUMX(Forecast|IF(Forecast[Sector]="AA"|Forecast[TRC Cost]+DIVIDE(MAX(Parameter2[Parameter2])|POWER(1.0766|2))|Forecast[TRC Cost])
)
)

 

 

and the Forecast table looks something like this:

 

SectorActivityYearBenefitsTRC Cost
AAA2020010
AAA2021020
BBA2022030
BBA2023040
CCB20202010
CCB20213030
DDB20224060
DDB202350100
AAC20203015
AAC20214040
BBC20225070
BBC202360100

 

  • Rob_B's avatar
    Rob_B
    6 years ago

    Thanks Pragati11, that's good to know!

     

    I was able to achieve the result I wanted by creating a new measure using the CALCULATE and FILTER functions with logical operators:

     

    Scenario TRC Ratio (adjusted) = CALCULATE(
    'Scenario Measures'[Scenario TRC Ratio]|Filter(Forecast|Forecast[Activity]<>"B" || Forecast[Activity]="B" && 'Scenario Measures'[Scenario TRC Ratio]>=1
    )
    )

     

2 Replies

  • Hi Rob_B ,

     

    To filter all the visualisations you need to have a slicer which can only be a column. You can never use a Measure in a slicer.

     

    If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! ๐Ÿ™‚

     

    Thanks,

    Pragati

    • Rob_B's avatar
      Rob_B
      Helper I

      Thanks Pragati11, that's good to know!

       

      I was able to achieve the result I wanted by creating a new measure using the CALCULATE and FILTER functions with logical operators:

       

      Scenario TRC Ratio (adjusted) = CALCULATE(
      'Scenario Measures'[Scenario TRC Ratio]|Filter(Forecast|Forecast[Activity]<>"B" || Forecast[Activity]="B" && 'Scenario Measures'[Scenario TRC Ratio]>=1
      )
      )