Format strings
Formatstrings are a way to show measures in certain way, without touching the underlying data. Formatstrings are able to do lot of things, but can get complex as well. That's why it is possible to use custom format strings in Easy Tabular with recognizable names. In formatstrings.yaml file the format string can be defined as follows:
- FriendlyName: DecimalNumberD0
Name: decimal
FormatString: "#,0;-#,0;0"
- FriendlyName: DecimalNumberD1
Name: decimal
FormatString: "#,0.0;-#,0.0;0.0"
- FriendlyName: DecimalNumberD2
Name: decimal
FormatString: "#,0.00;-#,0.00;0.00"
Imagine a measure where you want to set the formatstring and you just want 1 decimal shown, just type the friendlyname of the formatstring:
- Name: Revenue
Expression: |
CALCULATE (SUMX(Finance, [Revenue])
Formatstring: DecimalNumberD1
It also possible to use the normal formatstrings like #,0. But the advantage with formatstrings.yaml is that it is possible to change the formatstrings at one place and it will propagate everywhere when generated. It also saves a lot of time with finding out what the needed formatstring was, that you require, which can become quite complex.
Formatting options can be found here:
https://docs.microsoft.com/en-us/dax/format-function-dax
In general a custom format will look like this:
Decimal number: 0.0 Whole number: 0 Use # if you don't want a number when 0
For thousand seperator, use: ,
To divide by 1000, use multiple ,
Example:
1.000.000,00 (dutch format)
The formatting is default in VS style: #,##0.00
To remove 000 from it, just add a comma:
#,,##0.00 will result in: 1.000,00
You can easily try different formatting in Power BI, with a DAX measure.
FORMAT(100.54423, "<here your formatting>")