Forum Discussion
simuruge
6 years agoRegular Visitor
How do I create a measure that returns two different values based on condition
Hi, I am trying to trplicate a formula in Tableau like, ([Plan $] + IIF([Version]=[Version Toggle],[Perf $],0)) [Version] is a column in a table [Version Toggle] is a dynamic value where the...
- 6 years ago
Try something like this
Measure = VAR _toggleValue = CALCULATE ( SELECTEDVALUE ( 'Table1'[Toggle values] ) ) VAR _version = CALCULATE ( SELECTEDVALUE ( 'Table'[version] ) ) VAR _add = IF ( _togglevalue = _version, SUM ( 'Table'[Perf $] ), 0 ) VAR _sum = SUM ( 'Table'[Plan $] ) + _add RETURN _sumCan you provide sample data and expected output.
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂
v-diye-msft
Community Support
6 years agoHi simuruge
you might consider creating pbix file that will contain some sample data (remove the confidential info), upload the pbix to onedrive for business and share the link to the file. Please do not forget to describe the expected results based on this sample data.