Forum Discussion
Use selectedvalue in a column
Hi vbourbeau ,
You cannot make a calculated column value change according to the selection on a slicer, believe that you want to make this new column to present on a visual, so you need to make it with a measure.
Measures are calculated based on context that can be given by a number of elements including the Slicer.
Can you give a little more insight on how you want to use the result of the calculation so I can help you better.
Regards,
MFelix
- vbourbeau7 years ago
Resolver II
Ok look this example, it's what I'm tying to do. But in my real data I have more table to filter. So if I click on "last week" both table will filter for the last week result. I don't want to create new amount measure on each table because in reality I have 10 tables.
What I've trying it's create a column in the Date dimension who change value depending the slicer choice and add a page filter for that column.
I put my example here https://we.tl/t-Q6hNDlJyXq
- MFelix7 years ago
Super User
Hi vbourbeau ,
Looking at your model since you have the tables connect trough date table create the following measure:
Filter Dates = SWITCH ( TRUE (); SELECTEDVALUE ( 'Time'[Sequence] ) = 1; FILTER ( SUMMARIZE ( Dates; Dates[Date] ); Dates[Date] <= TODAY () && Dates[Date] >= TODAY () - 7 ); SELECTEDVALUE ( 'Time'[Sequence] ) = 2; FILTER ( SUMMARIZE ( Dates; Dates[Date] ); Dates[Date] <= TODAY () && Dates[Date] >= TODAY () - 84 ); SELECTEDVALUE ( 'Time'[Sequence] ) = 3; FILTER ( SUMMARIZE ( Dates; Dates[Date] ); Dates[Date] <= TODAY () && Dates[Date] >= TODAY () - 365 ) )Then add this as a filter on your tables and select the option not blank final result will be the following:
Check the PBIX file attach.
Regards,
MFelix
- vbourbeau7 years ago
Resolver II
Hi,
When I put the same logic in my full report I've got this message:
"A table of multiple values was supplied where a single value was expected"