Forum Discussion
How to use parameter in dax formulas?
Hey!
I have two columns (Gross investments and Net investments) and I created a parameter of these 2 columns. Now I would like to create some calculated measures (For example "Investments past year", "Investments difference Past Year", etc), using that column values, which is selected from parameter (Gross invetments or Net investments values). In short, i would like to know, which dax functions i have to use, so my calculated measures would be dynamical based on selected value on parameter.
Created Parameter:
3 Replies
- lbendlin
Super User
When you add Field Parameters to your report you get the boilerplate code for these too. and you can then refer to the parameter as if it were a measure.
- Walt1010
Helper V
But thats not the case with ordinary parameters, is it? I suppose you could do something clunky like create a new query per parameter...
- lbendlin
Super User
Ordinary parameters (the ones you define in Power Query) by default do not load into the semantic model as they are expressions. (They do show up in the Power BI service).
To make them accessible in the semantic model you need to change them into partitions. ("Enable Load"). Note that these are NOT dynamic. Think of them as the equivalent of calculated columns, NOT as the equivalent of measures. Changes in the parameter are only picked up during the semantic model refresh.