Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Is it possible to reference a parameter to a DAX function and how ?
Solved! Go to Solution.
It is possible through multiple steps, 2 possibilites exist depending on the volume of your tables
1. Use powerquery and merge your table with the parameter. The parameter will repeat on every line. You can then use it through calculations directly in powerquery, or with DAX.
Parameter 1 : 0,5
Vendor
John 1
John 2
John 3
With an outerleft join,
Vendor | Parameter 1 |
John 1 | 0,5 |
John 2 | 0,5 |
2. If your data has high volume, reference the parameter on your fact table using power query. like in example 1
In your 2nd table, use DAX and reference the value
LOOKUPVALUE( 'Infotable'[Parameter1], Info table[Vendor name]>, 'Currenttable'[Vendor] )
This will return the parameter 0,5 to every line, and can then be used for calculations using DAX
Where can we use these paramters once created? I can't find any way to use them.
@aghonaim In power bi desktop go to query editor -> right click your parameter and ensure Enable Load is checked. Then Parameters are just like any other query in Power BI Desktop and so you can reference them in DAX expressions.
Assume I want to create a cacluated column that multiply column "A" in Table 1 by the paramater "Pam". I got this error:
Hi @aghonaim,
In Power BI Desktop, we are not able to use Parameters in calculated columns. Regarding to this issue, you can vote it in the following existing idea.
https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/12891723-parameters-calculated-fi...
Thanks,
Lydia Zhang
OK I did vote, thanks!
Create a query new blank query and type = MYPARAMETER,
Than you can reference in columns/dax
It's a nice workaround, thanks!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
97 | |
77 | |
63 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |