Forum Discussion
Anonymous
5 years agoNot applicable
If SELECTEDVALUE returns blank, use default value - can not get AlternateResult to work
Hi PowerBI community!
I am been working on this problem for some time and can not seem to figure it out. Here is the scenario:
- I have a matrix with total amounts by currencies on it, and I want to calculate a new value based on a target percent.
- My table with the target percents will either have the currency listed, or if not specified will have a 'default' target percent.
- For the matrix I want to show the target percent if the currency is listed or the 'default' target if not.
This is what I get so far, essentialy I want to move the target percent from the blank row to the GBP row
I have tried SELECTEDVALUE, using the AlternateResult, but will not show the 'default value':
Thanks four your time, and have included a sample file if helpful. Thank you!!!
I'd try defining the default value as a variable. It's easier to debug that way.
Target (SelectedValue) = VAR Default = LOOKUPVALUE ( Target[Target], Target[Currency], "Default" ) RETURN IF ( NOT ISEMPTY ( Amount ), SELECTEDVALUE ( Target[Target], Default ) )
2 Replies
- AlexisOlson
Super User
I'd try defining the default value as a variable. It's easier to debug that way.
Target (SelectedValue) = VAR Default = LOOKUPVALUE ( Target[Target], Target[Currency], "Default" ) RETURN IF ( NOT ISEMPTY ( Amount ), SELECTEDVALUE ( Target[Target], Default ) )- AnonymousNot applicable
AlexisOlson Awesome! Thanks so much for taking a look, and figuring it out. much appreciated.