Forum Discussion
Anonymous
7 years agoNot applicable
DAX Formula | Selects Other Measure based on Value
Hi, I'm quite new to MS Power BI - Tools, so sorry in case I didn't pick exactly the right subject/location. Following issue I can't get to work: - I created two measures in Power Pivot (ACT_...
- 7 years ago
hi, Anonymous
sorry, there is a mistake when post the formula, try this
ACT_%_NEW:=IF(MAX('HIERARCHY'[GROSS_NET])=1 , [ACT_GROSS_%] , [ACT_NET_%])Best Regards,
Lin
v-lili6-msft
7 years agoCommunity Support
HI, Anonymous
You can use this formula to add a measure
ACT_%_NEW:=IF(SELECTEDVALUE('HIERARCHY'[GROSS_NET]=1) , [ACT_GROSS_%] , [ACT_NET_%])
Best Regards,
Lin
Anonymous
7 years agoNot applicable
Hi Lin,
thanks for the reply. Works fine in power bi. Is there also an "old way" of doing it directly in power pivot, where the selectedvalue function is not available?
- v-lili6-msft7 years agoCommunity Support
hi, Anonymous
Just use MAX instead of selectedvalue
ACT_%_NEW:=IF(MAX('HIERARCHY'[GROSS_NET]=1) , [ACT_GROSS_%] , [ACT_NET_%])Best Regards,
Lin
- Anonymous7 years agoNot applicable
Hi Lin, getting a semantic error, that MAX only accepts a column reference as an argument
- v-lili6-msft7 years agoCommunity Support
hi, Anonymous
sorry, there is a mistake when post the formula, try this
ACT_%_NEW:=IF(MAX('HIERARCHY'[GROSS_NET])=1 , [ACT_GROSS_%] , [ACT_NET_%])Best Regards,
Lin