Forum Discussion
Anonymous
6 years agoNot applicable
Including Switch/IF condition in measure
Dear All, I want Use according country my value has to divide with the given currency value, Switch and IF both are not Working In Measure Please find the Attached screenshot:
- 6 years ago
Hello Anonymous,
You can try below:Measure = VAR CurrencyValue = CALCULATE(MIN(Table[Value]),Table[Country]="SINGAPORE") RETURN DIVIDE(SUM('Append-France,Greece,Monaco'[Base Amount])/CurrencyValue,1000000)Hope this helps.
Anonymous
6 years agoNot applicable
Hi rajulshah ,
Measure =
VAR CurrencyValue = CALCULATE(MIN(Table[Value]),Table[Country]="SINGAPORE")
RETURN DIVIDE(SUM('Append-France,Greece,Monaco'[Base Amount])/CurrencyValue,1000000)It Is not Working for Other Countries ,can it be dynamic like if country is France it has to pick France or if it is Brazil it has to pick Brazil
rajulshah
Resident Rockstar
6 years agoYes, we can do this.
Please try below:
Measure =
VAR SelectedCountry = SELECTEDVALUE(Table[Country])
VAR CurrencyValue = CALCULATE(MIN(Table[Value]),FILTER(Table,Table[Country]=SelectedCountry))
RETURN DIVIDE(SUM('Append-France,Greece,Monaco'[Base Amount])/CurrencyValue,1000000)
Please let me know if this didn't work.