Forum Discussion
Anonymous
6 years agoNot applicable
Problem with SWITCH formula
Hello I try to write a SWITCH formula but it does not offer to autocomplete the table and column of my table when I enter the first parameter in the formula. It says: A single value for column ...
v-alq-msft
6 years agoCommunity Support
Hi, Anonymous
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
DifferentTable:
SameTable:
You may create a measure or a calculated column as below.
Calculated column:
Result Column =
var _col1 = [Col1]
return
CALCULATE(
DISTINCTCOUNT(DifferentTable[Col1]),
FILTER(
DifferentTable,
DifferentTable[Col2] = _col1
)
)
Measure:
Result Column =
var _col1 = [Col1]
return
CALCULATE(
DISTINCTCOUNT(DifferentTable[Col1]),
FILTER(
DifferentTable,
DifferentTable[Col2] = _col1
)
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.