data-warehousecubessas-tabulardimensional-modeling

Calculated column in SSAS covering for faulty modeling in the backend?


I have a legacy model in SSAS, where I have a Fact table with columns: Key_Parent_Segment and Key_Segment.

They both connect to a single role playing ClientSegment table.

And in the fact table there is a calculated column:

=IF(
    FactIncome[Key_Parent_Segment] < 0
    ,RELATED('Client Segment'[Segment])
    ,RELATED('Parent Client Segment'[Segment])
)

(In SSAS both Client Segment and Parent Client Segment have the same DimClientSegment as source)

Question: Isn't this a flaw in the model? Isn’t this calculated column just covering for some unfilled values at source/backend?


Solution

  • Isn't this a flaw in the model? Isn’t this calculated column just covering for some unfilled values at source/backend?

    As a practical matter a tabular model is always a little more specific and a little more complete than the data mart it's built on. It's quite common to make little changes in the tabular model that might ideally belong as design changes to the relational data mart. But practical considerations, like introducing breaking changes, or simple timing often make it more convenient to apply the change at the tabular model layer (at least initially).