Forum Discussion
replacing column values based on slicer slection
- Anonymous6 years ago
Hi chotu27
I build a table like yours to have test.
We need to build a new Slicer table by Category column.
Slicer = VALUES('Table'[Category])Then build a slicer.
Build a measure to achieve your goal.
Output = VAR _selectvalue = SELECTEDVALUE ( 'Slicer'[Category] ) RETURN IF ( MAX ( 'Table'[Category] ) = _selectvalue, MAX ( 'Table'[Category] ), CALCULATE ( MAX ( 'Table'[Datamasking] ), FILTER ( ALL ( 'Table' ), 'Table'[Category] = MAX ( 'Table'[Category] ) ) ) )Result:
Default:
Select Laon Care:
You can download the pbix file from this link: Replacing column values based on slicer slection
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi chotu27
I build a table like yours to have test.
We need to build a new Slicer table by Category column.
Slicer = VALUES('Table'[Category])
Then build a slicer.
Build a measure to achieve your goal.
Output =
VAR _selectvalue =
SELECTEDVALUE ( 'Slicer'[Category] )
RETURN
IF (
MAX ( 'Table'[Category] ) = _selectvalue,
MAX ( 'Table'[Category] ),
CALCULATE (
MAX ( 'Table'[Datamasking] ),
FILTER ( ALL ( 'Table' ), 'Table'[Category] = MAX ( 'Table'[Category] ) )
)
)
Result:
Default:
Select Laon Care:
You can download the pbix file from this link: Replacing column values based on slicer slection
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- chotu276 years agoPost Patron
Anonymous Thank you for your help i have a small questions
Q1 : If i remove Datamasking column from table it is not showing me the same results.
Q2: What if the user selects multiple values from slicer ? is there any possibilty to display multiple values selected in output?
- chotu276 years agoPost Patron
Anonymous Greg_Deckler
Can i Use Output Measure DAX in calculated column instead, beacause i wanted to use this column in some charts as legend
Thanks
- Anonymous6 years agoNot applicable
Hi chotu27
I build a new measure to you and you can display multiple values selected in output.
Output = VAR _selectvalue = ALLSELECTED ( 'Slicer'[Category] ) VAR _DateMasking = CALCULATE ( MAX ( 'Table'[Datamasking] ), FILTER ( ALL ( 'Table' ), 'Table'[Category] = MAX ( 'Table'[Category] ) ) ) RETURN IF ( ISFILTERED ( Slicer[Category] ), IF ( MAX ( 'Table'[Category] ) IN _selectvalue, MAX ( 'Table'[Category] ), _DateMasking ), _DateMasking )You can use Ctrl+left click the box to select the multiple value.
Result:
And if you want to remove Datamasking column from table visual, you need to make value column not summarize.
Result:
Calculated column can not show dynamic values like measure, but a measure can't be added into the legend.
I try to build a matrix visual to work like a legend.
You need to add color in conditional formatting and change the column header's and Grid 's color to white.
Result:
You can download the pbix file from this link: replacing column values based on slicer slection
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.