Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
This is the expression:
if(match(Source,'AAA',
'BBB','CCC'),
//then
Num (
Sum(
Aggr( Sum(TOTAL <Year, Month>{<Source={'AAAA'}>} Value)
*
Sum(TOTAL <Year, Month>{<Source={'DDD'}, Help={'EEE'}>} Value) , Year,Month )
)
/
Sum(TOTAL <Year, Month>{<Source={'DDD'}, Help={'EEE'}>} Value)
,'0.0%')
)
If I filter Source with value AAA it shows me the expected result, without this it's 0 and not working.
Any ideas why ? Thank you 🙂
When using match the result will be as follows for match(Source,'AAA',
'BBB','CCC')
Nothing selected in filter. = -
AAA selected in filter. = 1
BBB selected in filter. = 2
CCC selected in filter. = 3
DDD selected in filter. = 0
OK, and what should I modify/add in order to see the result without any filter applied? I want to add that I also tried with pick match functions and it had the same behavior. Thanks 🙂
Well your current measure is all hard coded so removing your if statement will just run your measure excluding any filters on the fields set in your measure.
Without some examples of data and what you expect the result to be its hard to advise on a suitable solution.
I would try breaking out your measure components into smaller measures so you can track what's happening when filters are applied. It will help you to understand what's going on with your data.
That's because you have specified it to be 0 if nothing is selected
Match() can only match A SINGLE VALUE, which means you are forcing a selection to be made
if(match(Source,'AAA','BBB','CCC'), < < if any of these are selected
//then
Num (
Sum(
Aggr( Sum(TOTAL <Year, Month>{<Source={'AAAA'}>} Value)
*
Sum(TOTAL <Year, Month>{<Source={'DDD'}, Help={'EEE'}>} Value) , Year,Month )
)
/
Sum(TOTAL <Year, Month>{<Source={'DDD'}, Help={'EEE'}>} Value)
,'0.0%' <<CURRENTLY if nothing is selected then return 0 << ADD YOUR EXPRESSION HERE instead of 0.0%
)
)