Forum Discussion

amalrio's avatar
amalrio
Icon for Helper V rankHelper V
5 years ago
Solved

filter a graph visual by a measure

Hi Gurus, 

 

I have a requirement to filer a graph visual by a measure, filter need to be at the visual level of the graph, and measure is a selected value coming from the report pane.

 

How do I go about it

 

any help would be appriciated.

 

thanks a lot.

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi amalrio ,

    What's your expected result? Which field of the table the slicer year plan is from? That is a default field in table or a a calculated column? If it is a calculated column, please provide the related formula. It will only display the data marked with red circle in table visual when select the option "2020 5 Year Plan" in the slicer?

    In addition, please update the formula of your measure [Measured in Plan] as below(the part with red font is new added) and check whether it can get your expected result:

    Measured in Plan =
    VAR Inferred = [Inferred in Plan]
    VAR Indicated = [Indicated in Plan]
    VAR Total = 1 - Inferred - Indicated
    VAR Result =
        DIVIDE (
            IF (
                Total = 0
                    || ISBLANK ( Indicated )
                    || ISBLANK ( Indicated ),
                BLANK (),
                Total
            ),
            1
        )
    RETURN
        Result

    Best Regards

4 Replies

  • Hi amitchandak , 

     

    Thanks for the reply, 

     

    my issue is when I select 2021 5 Year Plan, it also picks the year 2017 (which does not include in that plan) similar to that when I select 2020 5 Year Plan (I get 2026, which should not)

     

    2020 (shows 2026, and should not)

     

     

     

    I know it is a long shot without seeing the datamodel. I recon it is to do with Measured In Plan measure, which is below 

    Measured in Plan  =
    VAR
    Inferred = [Inferred in Plan] 
    VAR
    Indicated = [Indicated in Plan] 
    VAR
    Total = 1 - Inferred - Indicated  
    VAR Result = DIVIDE ( IF ( Total = 0, BLANK (), Total ), 1 )  
     
    RETURN
    Result

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi amalrio ,

      What's your expected result? Which field of the table the slicer year plan is from? That is a default field in table or a a calculated column? If it is a calculated column, please provide the related formula. It will only display the data marked with red circle in table visual when select the option "2020 5 Year Plan" in the slicer?

      In addition, please update the formula of your measure [Measured in Plan] as below(the part with red font is new added) and check whether it can get your expected result:

      Measured in Plan =
      VAR Inferred = [Inferred in Plan]
      VAR Indicated = [Indicated in Plan]
      VAR Total = 1 - Inferred - Indicated
      VAR Result =
          DIVIDE (
              IF (
                  Total = 0
                      || ISBLANK ( Indicated )
                      || ISBLANK ( Indicated ),
                  BLANK (),
                  Total
              ),
              1
          )
      RETURN
          Result

      Best Regards

      • amalrio's avatar
        amalrio
        Icon for Helper V rankHelper V

        Thanks a lot Rena, when I check is blank my issues get sorted, my issue was when Infrred and indicated are blank Measured in Plan  should not show either.