I have this expression which is in qlik sense syntax now i want to change / convert this into power bi dax syntax.. how i do that
if([Curency] = 'USD',
((Sum({< Fiscal_Year = {'2016','2017'},[Type_Billing] ={'N2','Z2'}>}[BSMA])
/Sum({< Fiscal_Year = {'2016','2017'},[Type_Billing] ={'N2','Z2'}>}[BSA_NETWR]))*vCurrency),
Sum({< Fiscal_Year = {'2016','2017'},[Type_Billing] ={'N2','Z2'}>}[BSMA])
/Sum({< Fiscal_Year = {'2016','2017'},[Type_Billing] ={'N2','Z2'}>}[BSA_NETWR]))
note : currenlty i dont have any power bi file
asked May 20, 2019 at 7:47
rebma testio
572 silver badges10 bronze badges
-
can you possibly explain what this measure is doing?StelioK– StelioK2019年05月20日 16:11:43 +00:00Commented May 20, 2019 at 16:11
-
this is dividing if currency is USD THEN divided (bsma/bsa_netwr) * vcurrency and (bsma/bsa_netwr) one is with vcurrency and the other is without currency .. on the bases of mentioned filtersrebma testio– rebma testio2019年05月22日 07:24:17 +00:00Commented May 22, 2019 at 7:24
1 Answer 1
You could try:
VAR USDFilter =
CALCULATE(
FILTER(
ALL('your_table_name'),
'your_table_name'[Curency] = "USD"
)
)
VAR Numerator =
SUMX(
USDFilter,
USDFilter[BSMA]
)
VAR Denominator =
SUMX(
USDFilter,
USDFilter[BSA_NETWR]
)
VAR Result =
IF(
COUNTROWS(USDFilter) > 0,
(Numerator / Denominator) * [vCurrency],
(Numerator / Denominator)
)
RETURN Result
To transcribe code languages, Bard and Chat GPT are a good option.
suxgri
1,0451 gold badge4 silver badges12 bronze badges
Sign up to request clarification or add additional context in comments.