Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I need to set a value when a selection has not been made. There is something wrong with this statement but I cannot figure out what:
Target Output if no selections have been made: (Sum{<[Multi Outlet]='Total US - Multi Outlet'>}[DS Sales])
Target Output if selections have been made: (Sum{<[Multi Outlet]=Selected>}[DS Sales])
My set analysis that is erroring out: Sum({$<[Multi Outlet] = {$(=If(GetSelectedCount([Multi Outlet])=0,'Total US - Multi Outlet',[Multi Outlet]))}>}[DS Sales])
You are getting an error because you can't do a IF-statement inside a set analysis.
However, you can do it, if you put your if-statement in a variable - let's call that variable v_NoSelection with the value:
If(GetSelectedCount([Multi Outlet])=0,'Total US - Multi Outlet',[Multi Outlet])
Then your final expression will look like this:
Sum({$<[Multi Outlet] = {"$(v_NoSelection)"}>}[DS Sales])
You are getting an error because you can't do a IF-statement inside a set analysis.
However, you can do it, if you put your if-statement in a variable - let's call that variable v_NoSelection with the value:
If(GetSelectedCount([Multi Outlet])=0,'Total US - Multi Outlet',[Multi Outlet])
Then your final expression will look like this:
Sum({$<[Multi Outlet] = {"$(v_NoSelection)"}>}[DS Sales])
You can also try this
=If(GetSelectedCount([Multi Outlet])=0,
Sum({$<[Multi Outlet] = {'Total US - Multi Outlet'}>} [DS Sales]),
Sum([DS Sales])
)