Forum Discussion
Fomat & Currency
So I have this code
- Anonymous6 years ago
Hi Anonymous ,
According to my understanding, you want to format currency with “S/” , right?
For my test,once format() is used, the type of the data will become String, then you can add "S/"&" "& before format() like this:
Moneda Seleccionada = VAR CAMBIO = SELECTEDVALUE ( Hoja4[SIGLAS] ) RETURN IF ( CAMBIO = "USD", FORMAT ( [TOTAL USD], "$ #.##" ), IF ( CAMBIO = "PE", "S/" & " " & FORMAT ( [TOTAL SOLES], "#.##" ), FORMAT ( [TOTAL REALES], "R$ #,##" ) ) )My visualization looks like this:
Is the result what you want? If you have any questions, please upload some data samples and expected output.
Please do mask sensitive data before uploading.
Best Regards,
Eyelyn Qin
4 Replies
- amitchandak
Super User
Anonymous , once you format with help from IF condition, it would become string.
refer the formats at
https://docs.microsoft.com/en-us/power-bi/desktop-custom-format-strings
- AnonymousNot applicable
Hi Anonymous ,
According to my understanding, you want to format currency with “S/” , right?
For my test,once format() is used, the type of the data will become String, then you can add "S/"&" "& before format() like this:
Moneda Seleccionada = VAR CAMBIO = SELECTEDVALUE ( Hoja4[SIGLAS] ) RETURN IF ( CAMBIO = "USD", FORMAT ( [TOTAL USD], "$ #.##" ), IF ( CAMBIO = "PE", "S/" & " " & FORMAT ( [TOTAL SOLES], "#.##" ), FORMAT ( [TOTAL REALES], "R$ #,##" ) ) )My visualization looks like this:
Is the result what you want? If you have any questions, please upload some data samples and expected output.
Please do mask sensitive data before uploading.
Best Regards,
Eyelyn Qin
- lbendlin
Super User
Use a backslash.
IF(CAMBIO="PE", FORMAT([TOTAL SOLES],"S\/ #.##"),
https://docs.microsoft.com/en-us/dax/custom-numeric-formats-for-the-format-function
- AnonymousNot applicableI copied it but didnt work T_T