Forum Discussion

Krishna_Mysore's avatar
8 years ago
Solved

Passing between parameters to a measure using Whatif Analysis

Hello Folks   I'm trying to build a What if Analysis using Parameters . I know how to pass the parameter values if a single value is selected, however my need is to use a range ieBetween Values wit...
  • v-xjiin-msft's avatar
    8 years ago

    Hi Krishna_Mysore,

     

    As I know, currently it is not supported to use multi valued parameter in Power BI desktop. It also means that we can only refer a single value parameter in measure, not the parameter range.

     

    So to achieve your requirement, I think we need do some workarounds. Like define two parameters, one used for the MIN value and one is for the MAX value. Then use two parameters in measure.

     

    Or, you can just use the between mode Slicer to filter data. Please refer: Use the numeric range slicer in Power BI Desktop 

     

    Thanks,
    Xi Jin.

  • MFelix's avatar
    MFelix
    8 years ago

    Hi Krishna_Mysore,

     

    When you use a measure since it's based on context it returns an error. 

     

    Try to change your measure to something like this:

     

    Avg Selling Price Filtered Range =
    VAR av_price = [Avg Selling Price (Billed) Monthly]
    RETURN
        CALCULATE (
            [Avg Selling Price (Billed) Monthly],
            FILTER (
                Table,
                av_price >= MIN ( Parameter[Parameter] )
                    && av_price <= MAX ( Parameter[Parameter] )
            )
        )

     

    Change Table by the name of the table that as your data.

     

    Regards,

    MFelix