Forum Discussion
Slicer Value in Column Formula
- Anonymous9 years ago
Hi Anonymous,
Power bi not support dynamic calculate column based on slicer, you can use measure to instead the column.
Create a table to store value.
Selector Table = VALUES('sample'[Recommendation Id])Add measure to Selector table to get selected value.
selected = IF(HASONEVALUE('Selector Table'[Recommendation Id]),VALUES('Selector Table'[Recommendation Id]),BLANK())Add measure to original table to calculate based on slicer.
Check = IF(MAX('sample'[Recommendation Id])=[selected],[selected],"Other Vendors")Regards,
Xiaoxin Sheng
Hi Anonymous,
Power bi not support dynamic calculate column based on slicer, you can use measure to instead the column.
Create a table to store value.
Selector Table = VALUES('sample'[Recommendation Id])
Add measure to Selector table to get selected value.
selected = IF(HASONEVALUE('Selector Table'[Recommendation Id]),VALUES('Selector Table'[Recommendation Id]),BLANK())
Add measure to original table to calculate based on slicer.
Check =
IF(MAX('sample'[Recommendation Id])=[selected],[selected],"Other Vendors")
Regards,
Xiaoxin Sheng
Hi,
Thank you so much for sharing this codes, it works perfect however I don't understand why we need to add the MAX function here (
MAX('sample'[Recommendation Id])The condition should be compared for each sample[Recomendation Id] but not its MAX value. Thank you.