Forum Discussion
Dynamic formatting
- 1 year ago
Hi FilipaPereira - you can create a measure as like below:
Currency Used =
IF (
HASONEVALUE('Comisões'[Moeda]),
SELECTEDVALUE('Comisões'[Moeda]),
IF (
COUNTROWS(VALUES('Comisões'[Moeda])) = 1,
VALUES('Comisões'[Moeda]),
"Mixed"
)
)another measure is for formatting the total detection follow: replace the table name as per your model
Formatted Total Commissions =
VAR _value = [TotalCommissions]
VAR _currency = [Currency Used]RETURN
SWITCH(
_currency,
"USD", FORMAT(_value, "#,##0.00 $"),
"EUR", FORMAT(_value, "#,##0.00 €"),
"Mixed", FORMAT(_value, "#,##0.00") & " (Mixed)",
FORMAT(_value, "#,##0.00") // fallback
)Hope this helps.
Hi FilipaPereira - you can create a measure as like below:
Currency Used =
IF (
HASONEVALUE('Comisões'[Moeda]),
SELECTEDVALUE('Comisões'[Moeda]),
IF (
COUNTROWS(VALUES('Comisões'[Moeda])) = 1,
VALUES('Comisões'[Moeda]),
"Mixed"
)
)
another measure is for formatting the total detection follow: replace the table name as per your model
Formatted Total Commissions =
VAR _value = [TotalCommissions]
VAR _currency = [Currency Used]
RETURN
SWITCH(
_currency,
"USD", FORMAT(_value, "#,##0.00 $"),
"EUR", FORMAT(_value, "#,##0.00 €"),
"Mixed", FORMAT(_value, "#,##0.00") & " (Mixed)",
FORMAT(_value, "#,##0.00") // fallback
)
Hope this helps.