Forum Discussion
Selected Value not returning the value
Hi,
What seemed like a simple solution has taken few hours now and still cant figure out the SelectedValue issue.
I have a Product table connected to a Promotions table with a relation 1 - many.
And have a filter for Promotion in the report.
I need to create few calculated columns in the Product table using SelectedValue on the filter but I dont get the selected value of the filter. It just returns blank. Is there any restriction on using the SelectedValue function, or is there a different way to use it?
| Product ID | Measure 1 |
| 11 | 2 |
| 111 | 22 |
| 1111 | 32 |
| Product ID | Promotion |
| 11 | Promo1 |
| 11 | Promo2 |
| 11 | Promo3 |
| 111 | Promo1 |
| 111 | Promo4 |
6 Replies
- Fowmy
Super User
PBIfanatic
If you are trying to create a calculated column then you cannot access what is selected in the report from any filter. This is because adding columns take place in the data modeling stage, once you complete that the data load and the model are ready for use in the report.- PBIfanatic
Helper V
thanks Fowmy
Is there a way to create a column on the fly based on the selected value from a filter?
- Fowmy
Super User
PBIfanatic
Yes, absolutely, you can use many table functions in DAX depending on your situation, for exampleFILTER ( ADDCOLUMNS ( VALUES ( 'Date'[Calendar Year] ), "@Amount", [Sales Amount], "@Quantity Wrong", SUM ( Sales[Quantity] ) ), [@Amount] > SELECTEDVALUE( Parameter[Amount] ) )
- jdbuchanan71
Super User
Calcualted columns are only updated when the model is refreshed. A filter (like a silcer) on a report won't do anything to a calculated column. Can you give us more information about what you are trying to accomplish?
Take a look at this post, it has a lot of information about what we need to help you with your question.
- PBIfanatic
Helper V
hi jdbuchanan71
if I had known this would have framed it differently.
I want to create a flag against each product based on some numerical values thats associated to the product(these values aer in other tables) for the Promotion filter selection.
- v-zhangti
Community Support
Hi, PBIfanatic
What is your expected output? Is it a slicer used? What is the expected result of using the selectedvalue function? Can you describe it or show it in pictures? Look forward to your reply. Thank you.
Best Regards,
Community Support Team _Charlotte