Forum Discussion
Anonymous
3 years agoNot applicable
Custom Column to return a value based on matching variable
I want a custom column that returns the Canada value if the variable matches
Thank you!!
| Region | Variable | Value | Custom Column |
Canada | A | 10 | 10 |
Canada | B | 20 | 20 |
| Ontario | A | 30 | 10 |
| Ontario | B | 40 | 20 |
| Alberta | A | 50 | 10 |
| Alberta | B | 60 | 20 |
| B-C | A | 70 | 10 |
Anonymous ,
Hope this will resolve your issue:
CustomColumn = VAR _Var = [Variable] VAR _Value = CALCULATE( MAX( YourTable[Value] ), FILTER( YourTable, YourTable[Region] = "Canada" && YourTable[Variable] = _Var )) RETURN _ValueRegards,
3 Replies
- rsbinCommunity Champion
Anonymous ,
Hope this will resolve your issue:
CustomColumn = VAR _Var = [Variable] VAR _Value = CALCULATE( MAX( YourTable[Value] ), FILTER( YourTable, YourTable[Region] = "Canada" && YourTable[Variable] = _Var )) RETURN _ValueRegards,
- AnonymousNot applicable
Works perfectly, thank you!
- speedrampsSuper User
sorry I dont understand "I want a custom column that returns the Canada value if the variable matches"
please give example of desired output from the above example. thanks