Forum Discussion

Sanyukti_Jain's avatar
Sanyukti_Jain
Advocate II
2 months ago
Solved

Semantic models & DAX

What's the best way to decide between using calculated columns vs measures in DAX when building a semantic model for Fabric? Looking for practical examples, not just the textbook definition.

  • Hi Sanyukti_Jain ,
    Thanks for reaching out to the Microsoft fabric community forum. 

     

    The easiest way to decide is to think about when the calculation should happen. If you need a value calculated and stored for every row in the table, use a calculated column. If you need a value that changes based on filters, slicers, or user selections in the report, use a measure. In most reporting scenarios, measures are preferred because they are more flexible and do not increase the model size.

     

    Calculated Column Example:

    Profit = Sales[Sales Amount] - Sales[Cost Amount].

    This creates and stores a profit value for each row.

     

    Measure Example:

    Total Sales = SUM(Sales[Sales Amount])

    This recalculates automatically based on the current report filters and selections.

     

    If I misunderstand your needs or you still have problems on it, please feel free to let us know. 

    Best Regards, 
    Community Support Team 

  • Hello Sanyukti_Jain ,

    My practical rule:

    • Use a Calculated Column when you need a value stored for every row (e.g., Customer Category, Profit per transaction, Year/Month columns).

    • Use a Measure when the result should change based on filters and slicers (e.g., Total Sales, Profit %, YTD Revenue).

    In most Fabric semantic models, I prefer Measures whenever possible because they're more flexible and don't increase model size.


    Rule of thumb: Row-level logic = Calculated Column, Aggregations/KPIs = Measure.

  • Hi Sanyukti_Jain

     

    Calculated columns and Measures are two very different things. 

     

    A measure is computed within the context of fields selected, that could be by using a slicer, or clicking a data field in a visual, or from using a drill through. 

     

    A calculated column is computed and stored for every row in the database, and does not depend on the context of what is selected. 

     

    If you need values stored for every row, use a calculated column. If it's something that needs to be dynamic based on what the user is doing, use a measure. 

     

    I would also add that unless the calculated column needs to make use of table relationships to pull values from another table, you should probably make the calcualted column in M (Power Query) rather than DAX as it is more storage efficient and more compute efficient most of the time.  

3 Replies

  • v-menakakota's avatar
    v-menakakota
    Community Support

    Hi Sanyukti_Jain ,
    Thanks for reaching out to the Microsoft fabric community forum. 

     

    The easiest way to decide is to think about when the calculation should happen. If you need a value calculated and stored for every row in the table, use a calculated column. If you need a value that changes based on filters, slicers, or user selections in the report, use a measure. In most reporting scenarios, measures are preferred because they are more flexible and do not increase the model size.

     

    Calculated Column Example:

    Profit = Sales[Sales Amount] - Sales[Cost Amount].

    This creates and stores a profit value for each row.

     

    Measure Example:

    Total Sales = SUM(Sales[Sales Amount])

    This recalculates automatically based on the current report filters and selections.

     

    If I misunderstand your needs or you still have problems on it, please feel free to let us know. 

    Best Regards, 
    Community Support Team 

  • Omkar_1712's avatar
    Omkar_1712
    Solution Specialist

    Hello Sanyukti_Jain ,

    My practical rule:

    • Use a Calculated Column when you need a value stored for every row (e.g., Customer Category, Profit per transaction, Year/Month columns).

    • Use a Measure when the result should change based on filters and slicers (e.g., Total Sales, Profit %, YTD Revenue).

    In most Fabric semantic models, I prefer Measures whenever possible because they're more flexible and don't increase model size.


    Rule of thumb: Row-level logic = Calculated Column, Aggregations/KPIs = Measure.

  • Hi Sanyukti_Jain

     

    Calculated columns and Measures are two very different things. 

     

    A measure is computed within the context of fields selected, that could be by using a slicer, or clicking a data field in a visual, or from using a drill through. 

     

    A calculated column is computed and stored for every row in the database, and does not depend on the context of what is selected. 

     

    If you need values stored for every row, use a calculated column. If it's something that needs to be dynamic based on what the user is doing, use a measure. 

     

    I would also add that unless the calculated column needs to make use of table relationships to pull values from another table, you should probably make the calcualted column in M (Power Query) rather than DAX as it is more storage efficient and more compute efficient most of the time.