Formatting your fields in your .yml files
Sometimes the format of things in your dbt project is different to how you want it to look in Lightdash. That’s okay! We’ve built a bunch of features to help you to format the fields in your dbt project so that the data in your Lightdash project looks exactly like you want it to 🥸The metrics and dimensions reference docs
We’re going to go through formatting your fields in more detail below, but you can see a list of these configurations and all of the other properties you can customize for your fields in the dimensions reference doc and metrics reference doc.Hiding fields
Sometimes, we have a bunch of columns in our YAML files that we might not want to include in Lightdash. For example, columns with PII data, or the same date data, but at different levels of date granularity. It’s easy to hide columns from Lightdash. All you need to do is add two words to your column:hidden: true
.
In your dbt YAML file, it’ll look something like this:
hidden: false
.
Grouping fields in the sidebar
You can group related metrics and dimensions together using the model metagroup_details
block in combination with the groups
property in your .yaml files. You can as well add descriptions to your groups using the property description
that will be displayed when hovering over the group label.
Max grouping levels.There is a max of 2 levels of grouping in the sidebar.
group
property to your metrics like so:

metrics
section, and your dimensions will get grouped together under your label in the dimensions
section.
Adding custom descriptions
Dimensions
By default, Lightdash pulls in the descriptions you’ve included for your dimensions. But, you can override the description you see in Lightdash using thedescription
property.

Metrics
If you don’t add a custom description for your metric, Lightdash will show a description for you in the app, by default. To override this default description, you can use thedescription
property.
Renaming fields
Sometimes, the labels we use for the fields in our dbt project aren’t very user friendly. We might want to change these in Lightdash, and we can! To change the name you’ll see for your field in Lightdash, you just use thelabel
property.
So, if I had a field user_id_sha64
, I could relabel it to User ID
.
Relabelling a metric will not break any saved charts that use the old metric name. Instead, your saved charts will just use the new metric name in their results tables.
Rounding
Rounding your metrics is easy to do using theformat
property in your YAML file.
Here’s an example of how different rounding will affect your numbers:
Original number | Format value | How it will appear in Lightdash |
---|---|---|
121.854 | ’0.00’ | 121.85 |
121.854 | ’0.0’ | 121.9 |
121.854 | ’0’ | 123 |
Rounding dimensions
Like this:Rounding metrics
Like this:Compacting big numbers
Here’s an example of how different compacting will affect your numbers:Original number | Format value | How it will appear in Lightdash |
---|---|---|
1000000000 | ’0’ | 1000000000 |
1000000000 | ’0,” K“‘ | 1000000K |
1000000000 | ’0,,” M“‘ | 1000M |
Compact dimensions
Like this:Compact metrics
Like this:Add units to your values
Some columns need a special format to convey what units they’re in. For example, if you’re a global company, and you have arevenue
field. Is that in GBP? USD?
In Lightdash, you can use the format
label to add units to your fields.
Here’s an example of how different formats will affect your values:
Original value | Format value | How it will appear in Lightdash |
---|---|---|
121.854 | ’[$£]#,##0.00’ | £121.85 |
121.854 | ’$#,##0.00’ | $121.90 |
Add units to dimensions
You can add aformat
to your dimensions this:
Add units to metrics
You can add aformat
to your metrics this:
Formatting your fields in the Lightdash UI
You can also format your fields in the Lightdash UI. This is useful if you want to format your fields quickly without having to change your YAML files. Currently you can format 2 types of fields in the Lightdash UI:Formatting metrics
Metrics formatting is currently only available for numeric metric types.


-
percent
: Formats your metric as a percentage, with the following options:round
value to your metric to round it to a certain number of decimal placesseparator
, e.g. from.
to,
-
currency
: Formats your metric as a currencyround
value to your metric to round it to a certain number of decimal placesseparator
, e.g. from.
to,
currency
symbol, e.g. from$
to£
compact
value to compact your metric to a certain unit, e.g. from1,000,000
to1M
-
number
: Formats your metric as a numberround
value to your metric to round it to a certain number of decimal placesseparator
, e.g. from.
to,
compact
value to compact your metric to a certain unit, e.g. from1,000,000
to1M
prefix
value to add a prefix to your metric, e.g.+
or-
suffix
value to add a suffix to your metric, e.g.%
Formatting table calculations
On the results table, you can add a table calculation by clicking on the button on the right hand side of the section.
Format
tab:

-
percent
: Formats your metric as a percentage, with the following options:round
value to your metric to round it to a certain number of decimal placesseparator
, e.g. from.
to,
-
currency
: Formats your metric as a currencyround
value to your metric to round it to a certain number of decimal placesseparator
, e.g. from.
to,
currency
symbol, e.g. from$
to£
compact
value to compact your metric to a certain unit, e.g. from1,000,000
to1M
-
number
: Formats your metric as a numberround
value to your metric to round it to a certain number of decimal placesseparator
, e.g. from.
to,
compact
value to compact your metric to a certain unit, e.g. from1,000,000
to1M
prefix
value to add a prefix to your metric, e.g.+
or-
suffix
value to add a suffix to your metric, e.g.%