Forum Discussion
Evaluate Measure in Calculated Column with Disconnected Table
- 5 years ago
Hi Anonymous ,
I create a table: SlicerValue
Column1 1 2 0 And a Calculate Table:
Calculate Table = CROSSJOIN( DISTINCT('Table'[Period]), SlicerValue )Then create measure and filter Column1 field by Measure.
Measure = var currentyear = SELECTEDVALUE('Year Filter'[Year Filter]) var selection = IF(currentyear = 2020, 1, IF(currentyear = 2021, 2, 0)) return IF( MAX('Calculate Table'[Column1]) = selection, 1 )If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
WinnizIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous , You can not use a slicer value or a measure in a calculated column. You have to create another measure for your requirement.
I need it to be a column because i have to create relationships based on it and also use it as a filter on the page. There is no option i can use? thank you
- v-kkf-msft5 years agoCommunity Support
Hi Anonymous ,
What data do you want to filter by measure Selection validation?
The values in calculated column cannot change with the value of slicer. Please share sample data that don't contain sensitive data and expected output, maybe we can do it in a different way.
Best Regards,
Winniz- Anonymous5 years agoNot applicable
Hello,
I have a disconnected table, with 2 values: 2020, 2021.
I need to use these 2 values in a slicer to filter the periods table based on some logic.
If i put the logic in a measure, it works.
If i put the logic in a calculated column, it does not work. Simplified logic can be see in the picture above.
Given the fact that it works with the measure, i want to make my calculated column = measure.
Currently i do not have a sample data file.
Thank you
- v-kkf-msft5 years agoCommunity Support
Hi Anonymous ,
I create a table: SlicerValue
Column1 1 2 0 And a Calculate Table:
Calculate Table = CROSSJOIN( DISTINCT('Table'[Period]), SlicerValue )Then create measure and filter Column1 field by Measure.
Measure = var currentyear = SELECTEDVALUE('Year Filter'[Year Filter]) var selection = IF(currentyear = 2020, 1, IF(currentyear = 2021, 2, 0)) return IF( MAX('Calculate Table'[Column1]) = selection, 1 )If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
WinnizIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.