Forum Discussion

klehar's avatar
klehar
Helper V
5 years ago

Getting incorrect value for what if parameter

Hi,

 

I have created a 'what if' parameter with values between 1 to 20%

 

 

Lease Rate Factor OP = GENERATESERIES(CURRENCY(0), CURRENCY(0.1), CURRENCY(0.0025))

 

 

 

I then want to use the selection on my calculations so I have the below(auto generated from what if slicer)

 

 

Lease Rate Factor Value = SELECTEDVALUE('Lease Rate Factor OP'[Lease Rate Factor], 1)

 

 

 

I now have a fact table where I want to use this selected value so I write this calculation in my fact table

 

 

Lease Rate Col Value 3 = 

VAR temp = 'Lease Rate Factor OP'[Lease Rate Factor Value]
RETURN temp/2

 

 

 

This always returns me the value 4.

I have realised that this is becuase my fact table has 8 rows of data and then i divide it by 2

This should return me the selected value of my slicer and then divide it by 2.

 

I know this issue is concerned with mixing measures with calculated columns but I need to acheive this.

How can i do this?

 

Power BI file link

 

amitchandak please dont spam with links. Reply only if you have a solution.

6 Replies

    • klehar's avatar
      klehar
      Helper V

      Jihwan_Kim I know how to create a measure. I'm trying to mix measures with calculated columns

       

      • v-yingjl's avatar
        v-yingjl
        Community Support

        Hi klehar ,

        In power bi, calculated column are static while measures are dynamic. Calculated column results would not be changed with the measures change dynamically.

        In your sample file, to get the half value of [Lease Rate Factor Value] measure, you need to create measure instead of calulated column:

        Measure = [Lease Rate Factor Value] / 2

         

        For your previous calculated column [Lease Rate Col Value 3], it shows the summarized value in the table initially. Change it to 'Don't summarize' you will find the the value is 0.5 not 4 because it calulates 1 / 2 from the measure [Lease Rate Factor Value] since calculated columns would not affect by measure.

         

        Best Regards,
        Community Support Team _ Yingjie Li
        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Anonymous's avatar
    Anonymous
    Not applicable

    klehar 

     

    Base tables (not talking about visuals) in Power BI are always STATIC. You can't make changes to such a table through a parameter that is selected later. Such tables are recalculated only during a refresh.

     

    Sorry 😞