Forum Discussion
Anonymous
9 years agoNot applicable
Passing Parameters in measures
Hi, Thanks everyone for the comments for my previos posts. I have one more question which I would like to clarify, Is there a way to parameterize values in Measures. For eg: I have created a measu...
- 9 years ago
Anonymous,
Currently, we cannot use a parameter in a calculated measure directly. To work around this requirement, we could create a query to store parameter value in a dataset, and then use this dataset value in your calculated measure. Please refer to the sample steps below.
- Sample parameter.
- Create a blank query and edit the query in Advanced Editor
- Create a measure in your original table like below.
Total Sales = CALCULATE(
SUM('Headcount Data'[May-17]),
FILTER(Year_Month,Year_Month[Year_Month]=Max(Query2[ParameterDate]))
)
Regards,
Chalrie Liao
- Sample parameter.
v-caliao-msft
9 years agoMicrosoft Employee
Anonymous,
Currently, we cannot use a parameter in a calculated measure directly. To work around this requirement, we could create a query to store parameter value in a dataset, and then use this dataset value in your calculated measure. Please refer to the sample steps below.
- Sample parameter.
- Create a blank query and edit the query in Advanced Editor
- Create a measure in your original table like below.
Total Sales = CALCULATE(
SUM('Headcount Data'[May-17]),
FILTER(Year_Month,Year_Month[Year_Month]=Max(Query2[ParameterDate]))
)
Regards,
Chalrie Liao
- Anonymous2 years agoNot applicable
I would like to learn more about this approch.
Do you have an videos or other material you could suggest?