Forum Discussion
Field Parameters in Measures
It depends on what you want to do.
Field Parameters create a Custom table, and you can reference the columns from this table in your measures and work with their values.
Can you provide a more specific example you want to achive?
Kind regards,
José
Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos! 🙂
- nitinrungta3 years agoFrequent Visitor
Anonymous I understand what you are trying to say, but I really don't think that really helps in any way. Thanks, anyway.
I will really consider you a Guru if you can tackle this for me.
I have a field parameter table of three measures:
vs PY
vs PM
vs PWI also have a separate Color Measure
ColorMeasure PM =
VAR myEventResult =
[vs PM]
RETURN
SWITCH (
TRUE (),
myEventResult > 0.05, "#73B761",
myEventResult > 0 && myEventResult <= 0.05 , "#f7db03",
myEventResult <= 0, "#CD4C46"
)Now, this is what I want to achieve. Very short and simple -
When I select vs PY then I want the color measure to change from [vs PM] to [vs PY]
How do I do this? Greg_Deckler amitchandak please could you provide your valuable insight.
- data-wrangler3 years agoNew Member
Hi,
As per your original questions; "Is there a way to use the Field Parameters in Measures for different calculations?"... I'm not sure if this is totally necessary to achieve the dynamic colour of bars in your graph you've refered to as your actual challenge, based on your selected measure in your field parameter slicer. With that said, I could be interpreting the challenge incorrectly.
You may be able to refer to the measure itself?
Try this calculation:ColourMeasure =VAR _SelectedValue = // This Variable is a workaround for using selectedvalue() with the new field parameters functionalityCONCATENATEX (SELECTCOLUMNS (SUMMARIZE ( 'Measure Selector', 'Measure Selector'[Measure], 'Measure Selector'[Parameter Fields]),'Measure Selector'[Measure]),'Measure Selector'[Measure], ", " )VAR _ColorPY =SWITCH (TRUE (),[vs PY] > 0.05, "#73B761", -- Change to whatever desired value threshold and color[vs PY] > 0 && [vs PY] <= 0.05 , "#f7db03",[vs PY] <= 0, "#CD4C46")VAR _ColorPM =SWITCH (TRUE (),[vs PM] > 0.05, "#73B761",[vs PM] > 0 && [vs PM] <= 0.05 , "#f7db03",[vs PM] <= 0, "#CD4C46")VAR _ColorPW =SWITCH (TRUE (),[vs PW] > 0.05, "#73B761",[vs PW] > 0 && [vs PW] <= 0.05 , "#f7db03",[vs PW] <= 0, "#CD4C46")RETURNSWITCH(TRUE(),_SelectedValue = "vs PY", _ColorPY,_SelectedValue = "vs PM", _ColorPM,_SelectedValue = "vs PW", _ColorPW)
The calculation may seem verbose, but seeing as you only have 3 measures in your field parameter, its relatively straight forward and gets the job done.
Let me know if this solves your issue?
- Anonymous3 years agoNot applicable
Anonymous , Let's consider that I create a field parameter with 2 measures A and B. Now could you please tell me what syntax is apt to reference the measure A in another new measure calculation?