March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
So high level, I'm looking to bring in my x/y axis calculations for a report from a metadata table in my database. I have the following DAX expression I put in a Measure that works when I reference MOPR in the y-axis column value:
MOPR = Sum(mview_PARTS[PM_GOOD_TNE_PROD])/Sum(mview_PARTS[TRGT_PM_Prod])*100
So I created a parameter called yAxisExpression and loaded the above calc into it in the Power Query Editor and I want to bring the parameter's value into my y-axis. So I tried a measure like this:
mtest_Measure = 'yAxisExpression'[yAxisExpression]
I get the following error:
A single value for column 'yAxisExpression' in table 'yAxisExpression' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.
I can't seem to find much info on how to reference a parameter like this.
Solved! Go to Solution.
Hi @Dave82,
So you mean you want to create a query parameter in the query editor and you want to extract that parameter value in DAX expressions?
If that is the case, I'd like to suggest you turn on the 'enable load' option of the parameter to enable power bi to transform and generated the data model table then you can use Dax aggregation functions to extract parameter table values. (e.g. min, max )
BTW, current power bi does not support working with measure expressions at the axis or legends fields. So if you want to use the custom field as the chart axis, please create a calculated table instead. After these steps, you need to write a measure on the value field to interact with the axis/legend and calculate results based on the current axis.
Regards,
Xiaoxin Sheng
I'm not sure I understand why you're creating a new parameter. Doesn't [MOPR] work as your y-value?
I want to switch the yaxis value dynamically while storing the calculations in a database table
Sorry. I don't follow what you mean.
Can you give an example of what you're trying to switch between?
I just need to know how to get a parameter value and load the text into a measure? Is that possible?
Hi @Dave82,
So you mean you want to create a query parameter in the query editor and you want to extract that parameter value in DAX expressions?
If that is the case, I'd like to suggest you turn on the 'enable load' option of the parameter to enable power bi to transform and generated the data model table then you can use Dax aggregation functions to extract parameter table values. (e.g. min, max )
BTW, current power bi does not support working with measure expressions at the axis or legends fields. So if you want to use the custom field as the chart axis, please create a calculated table instead. After these steps, you need to write a measure on the value field to interact with the axis/legend and calculate results based on the current axis.
Regards,
Xiaoxin Sheng
I'm still not sure what you're asking, so I don't know if it's possible.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
21 | |
14 | |
11 | |
8 | |
5 |
User | Count |
---|---|
26 | |
21 | |
20 | |
14 | |
10 |