Metacenta

BI semantic layer · rule definition-inconsistent

One BI measure name, several definitions

A Metacenta review checks this under the rule A business measure is defined once. Everything below applies whether or not you ever commission one.

What this rule checks

This rule groups BI measures by name across LookML, Power BI and Tableau, so Gross Revenue matches gross_revenue. It flags a name defined in more than one way. Generic names such as count and total are skipped.

Why it matters

Two people asking for the same measure can see different numbers, depending on which explore or report they open. Nobody can say which is right without reading the code. We rate it higher when two or more explores or dashboards read the definitions.

How to fix it

Give each business measure one definition. Decide which definition is canonical and keep it in one place, such as a shared view or the dbt metric. Point the others at it. Rename a deliberate variant so its name says so.

Before:

view: orders {
  measure: revenue {
    type: sum
    sql: ${TABLE}.amount ;;
  }
}
view: order_refunds {
  measure: revenue {
    type: sum
    sql: ${TABLE}.amount - ${TABLE}.refunded ;;
  }
}

After:

view: orders {
  measure: revenue {
    type: sum
    sql: ${TABLE}.amount ;;
  }
}
view: order_refunds {
  measure: revenue_net_of_refunds {
    type: sum
    sql: ${TABLE}.amount - ${TABLE}.refunded ;;
  }
}

When it is fine to leave

Two definitions can differ in text yet compute one number, and a quick look settles it. A deliberate variant is fine once its name says what differs. We report a difference in text, never that the numbers disagree.

What we need to check it

At least one BI layer: .lkml files, PBIP .tmdl files or Tableau workbooks. We compare definitions by fingerprint, which ignores case, whitespace, comments and quoting. The SQL and DAX text is dropped unless you opt in to showing definitions. A DAX and a LookML fingerprint cannot be compared, so across tools we report separate definitions.