Forum Discussion
Selectedvalue of a parameter
Hi,
I have a parameter A= GENERATESERIES(1, 3, 1) when i try to use selectedvalue function to get the value of A like this
- Anonymous4 years ago
Hi Datavizuserpbi ,
I have create a data sample for better understanding:
1.If you want to dynamically show values based on slicer, you should use measure since calculated column is static which could not dynamically changed.
And it's a dropdown list , and multiply selections, please use ALLSELECTED() to get all selections:
Measure = var _sele=ALLSELECTED(A[Value]) return IF(MAX('Table2'[Column X]) in _sele,1,0)2.Or if you just want to add a column to Table A , please try:
Column = VAR _S=SWITCH([Value], 1,MAX('Table2'[Column X]), 2,MIN('Table2'[Column Y]), 3,MAX('Table2'[Column Z]) ) RETURN CONVERT(_S,STRING)If both are not your expected outputs, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.
Refer to:
How to Get Your Question Answered Quickly - Microsoft Power BI Community
How to provide sample data in the Power BI Forum - Microsoft Power BI Community
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
4 Replies
- johnt75
Super User
It depends on what sort of slicer you are using. If you are using a List or Dropdown then SELECTEDVALUE should work, as long as only 1 item is selected. If you are using a Between, Less than or Greater than slicer then SELECTEDVALUE will not work, you would need to use either MIN or MAX
- Datavizuserpbi
Helper I
Hello, it's a dropdown list and if i select 2 or 3 ,value always return Blank() so the switch return 0 .
- johnt75
Super User
Selected Val is just
Selected Val = SELECTEDVALUE('Table'[A])
- AnonymousNot applicable
Hi Datavizuserpbi ,
I have create a data sample for better understanding:
1.If you want to dynamically show values based on slicer, you should use measure since calculated column is static which could not dynamically changed.
And it's a dropdown list , and multiply selections, please use ALLSELECTED() to get all selections:
Measure = var _sele=ALLSELECTED(A[Value]) return IF(MAX('Table2'[Column X]) in _sele,1,0)2.Or if you just want to add a column to Table A , please try:
Column = VAR _S=SWITCH([Value], 1,MAX('Table2'[Column X]), 2,MIN('Table2'[Column Y]), 3,MAX('Table2'[Column Z]) ) RETURN CONVERT(_S,STRING)If both are not your expected outputs, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.
Refer to:
How to Get Your Question Answered Quickly - Microsoft Power BI Community
How to provide sample data in the Power BI Forum - Microsoft Power BI Community
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.