Forum Discussion

dreyz64's avatar
dreyz64
Helper III
6 years ago
Solved

Help - Filtering a visualization based on a parameter and a measure not working

Hi everyone,

 

I now have been struggling for a while with this and I am going mad as I'm sure this is something simple.

I have created a table where I have various products, their actual sales, forecasted sales and the % difference between actual sales and forecasted sales (%Change).

I have created a parameter (0-100%) and what I want to do now is to filter the below table so that only the %Change (in absolute value) that are bigger than my parameter value get shown.

 

The filter that I have created is like this:

Type: Column --> Filter =  IF(divide(Parameter[Parameter Value],100)<=abs([%Change]), TRUE,FALSE)

However it is not working in my table. As you can see below, when i plot in my table 'Test filter 3' I get correct values but 'Filter' is wrong.
Test Filter 3 = divide(Parameter[Parameter Value],100)<=abs([%Change])

 

What am I doing wrong? Is it because my columns are dates and thus my filter is calculated differently than my measure?

Thanks!

 

 

 

 

 

  • Hi dreyz64 ,

     

    This as to do with context I have made a single measure the actuals:

     

    Actuals_Final = SUMX(SUMMARIZE(Sheet1;Sheet1[DATE];"@ACTUALS";[ACTUALS2]);[@ACTUALS])

     

    This is additional on top of the ACTUALS2 so you need to have a intermidiate measure to calculate the values.

     

    Please check if is working correctly on the PBIX file.

     

    If it works you need to do a similar thing for forecast. and then use those measures on the Change %2

15 Replies

  • Hi dreyz64 ,

     

    Is your parameter a % column (formatt as text) or a number formated as percentage?

     

    If it's the last one you should compare with 1 and not with 100, because 100% is just a visual format the actual number is 1.

    • dreyz64's avatar
      dreyz64
      Helper III

      Hi MFelix ,

      My parameter is an integer and then when I do my filter is do divide(parameter, 100) so in the end, it is between 0 and 1.

      But for my users they can directly input the whole number.

      • MFelix's avatar
        MFelix
        Super User

        Hi dreyz64 ,

         

        can you please share a sample file? is difficul to see based on your image what are the formats values etc. used, and when using measure the context is the most important part.

         

        Changing the context of a measure can make very different result than what we are expecting.