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.
Hi All,
It feels simple but I have searched for a few hours to no avail!
I am trying to use the selectedvalue function to inform a variable which is then used in a measure. Basically when I replace the selectedvalue with text, then it all works e.g. Intype="Test" works fine, but if I use Selectedvalue aligned to a field which produces "Test" it does not.
I am assuming the ourput of the Selected value needs formatting to be able to be used in the measure but I'm not sure how.
Massively grateful for any pointers!
What's the default value you're planning to pass in Interactions[Enterprise Interaction Type] ? the table you refer has only one value or multiple values, it will return blanks if multi availble.
Hi there LW,
I've not used a default value as I am happy to have zero if there are multiple values.
Desired output:
Discussion Topic Selected in Slicer: "Impact"
Name Interactions
Jim 2
John 0
Alex 1
Found this post, very much related to what you're trying to do. You need to tweak your DAX code.
https://community.powerbi.com/t5/Desktop/Use-selectedvalue-in-a-measure/td-p/483456
In order to understand SELECTEDVALUE functionality;
https://docs.microsoft.com/en-us/dax/selectedvalue-function
Thanks
Just for further context, I am essentially trying to replicate the "Difference from Filtered Value" Quick measure except using a dynamic filter.
Hi @junglejimsvet some examples on this link https://www.sqlbi.com/articles/using-the-selectedvalue-function-in-dax/
regards.
Many thanks, its a really good page. Unfortunately it does not look like it is possible to do what I need to do - I think VAR can only be used with numeric fields so I can't put text in there (although I can use variales with typed text rather than text producted from a formula)
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 |
---|---|
116 | |
104 | |
77 | |
71 | |
50 |
User | Count |
---|---|
146 | |
107 | |
106 | |
89 | |
65 |