Forum Discussion
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
- Jihwan_KimSuper User
Hi, klehar
I am not sure whether I understood your question correctly, but to create a measure, please check the below.
https://www.dropbox.com/s/1oc1olmyul5ac61/What%20if%20issue.pbix?dl=0
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM
- kleharHelper V
Jihwan_Kim I know how to create a measure. I'm trying to mix measures with calculated columns
- v-yingjlCommunity 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] / 2For 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.
- AnonymousNot applicable
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 😞