Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Good day
I have a currency conversion measure, but I want it to default to the South African Rand if no currency has been selected from the slicer, also Zimbabwe uses the US Dollar when capturing their amounts but when it is selected, it returns blank values and there is data for Zimbabwe.
My measure:
Total Amount with Currency =
I tried adding this to the measure but it doesn't work, unless I comment out everything, for the default currency.
Please assist me.
Solved! Go to Solution.
You can try the following code.
Total Amount with Currency =
SWITCH (
TRUE (),
[Selected Currency] = "Mozambican Metical",
"MT"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" ),
[Selected Currency] = "Naira",
"₦"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" ),
[Selected Currency] = "Lesotho Loti",
"L"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" ),
[Selected Currency] = "Zimbabwean Dollars",
"$"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" ),
[Selected Currency] = "Malawian Kwacha",
"MK"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" ),
[Selected Currency] = "Shilingi ya Kenya",
"Ksh"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" ),
[Selected Currency] = "Tanzanian Shilling",
"TSh"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" ),
[Selected Currency] = "Ugandan Shilling",
"Ush"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" ),
[Selected Currency] = "Botswanan Pula",
"P"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" ),
[Selected Currency] = "Congolese franc",
"FC"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" ),
[Selected Currency] = "Zambian Kwacha",
"K"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" ),
[Selected Currency] = "Angolan Kwanza",
"Kz"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" ),
[Selected Currency] = "Tanzanian Shilling",
"Tsh"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" ),
[Selected Currency] = "Ghanaian Cedi",
"GH₵"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" ),
[Selected Currency] = "Mauritian Rupee",
"Rs"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" ),
[Selected Currency] = "Namibian Dollar",
"N$"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" ),
[Selected Currency] = "Swazi Lilangeni",
"SZL"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" ),
"R"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" )
)
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
You can try the following code.
Total Amount with Currency =
SWITCH (
TRUE (),
[Selected Currency] = "Mozambican Metical",
"MT"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" ),
[Selected Currency] = "Naira",
"₦"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" ),
[Selected Currency] = "Lesotho Loti",
"L"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" ),
[Selected Currency] = "Zimbabwean Dollars",
"$"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" ),
[Selected Currency] = "Malawian Kwacha",
"MK"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" ),
[Selected Currency] = "Shilingi ya Kenya",
"Ksh"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" ),
[Selected Currency] = "Tanzanian Shilling",
"TSh"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" ),
[Selected Currency] = "Ugandan Shilling",
"Ush"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" ),
[Selected Currency] = "Botswanan Pula",
"P"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" ),
[Selected Currency] = "Congolese franc",
"FC"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" ),
[Selected Currency] = "Zambian Kwacha",
"K"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" ),
[Selected Currency] = "Angolan Kwanza",
"Kz"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" ),
[Selected Currency] = "Tanzanian Shilling",
"Tsh"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" ),
[Selected Currency] = "Ghanaian Cedi",
"GH₵"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" ),
[Selected Currency] = "Mauritian Rupee",
"Rs"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" ),
[Selected Currency] = "Namibian Dollar",
"N$"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" ),
[Selected Currency] = "Swazi Lilangeni",
"SZL"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" ),
"R"
& FORMAT ( [Claim Amount] * VALUES ( TransactionCurrency[exchangerate] ), "0,00" )
)
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.