Forum Discussion
cn4422
2 years agoHelper V
Create a relationship between Fact Table Values and Measure Values
Hi, I have attached a screenshot of what I would like to accomplish. The idea is to create CPL (Cost-per-Lead) for different countries and display them over a certain time period. I have ...
- 1 year agoCPL FB =SWITCH(SELECTEDVALUE(Countries[Country]),"DE",DIVIDE([Sum Spend DE FB],[Sum Leads DE FB],0),"AT",DIVIDE([Sum Spend AT FB],[Sum Leads AT FB],0))
cn4422
1 year agoHelper V
lbendlin wrote:In that case you are indeed staring down the barrel of having to use the SWITCH statement 17 times.
Ok, thanks for clarifying this. 😄
I'm still trying to figure out the correct SWITCH statement for this case.
In the meantime I was wondering if there is a way with the IF-measure you provided that it only shows the relevant row and no row if it does not suite. I tried it this way, but it's still showing an (empty) row:
CPL FB =
IF(SELECTEDVALUE(Countries[Country])="DE",DIVIDE([Sum Spend DE FB],[Sum Leads DE FB],0))
lbendlin
1 year agoSuper User
CPL FB =
SWITCH(SELECTEDVALUE(Countries[Country]),
"DE",DIVIDE([Sum Spend DE FB],[Sum Leads DE FB],0),
"AT",DIVIDE([Sum Spend AT FB],[Sum Leads AT FB],0)
)