Tuesday, September 20, 2022

Calculated columns and measures

 Measure DAX

Numeric columns support the greatest range of aggregation functions:

  • Sum
  • Average
  • Minimum
  • Maximum
  • Count (Distinct)
  • Count
  • Standard deviation
  • Variance
  • Median

Summarize non-numeric columns

Non-numeric columns can be summarized. However, the sigma symbol does not show next to non-numeric columns in the Fields pane because they don't summarize by default.

Text columns allow the following aggregations:

  • First (alphabetically)
  • Last (alphabetically)
  • Count (Distinct)
  • Count

Date columns allow the following aggregations:

  • Earliest
  • Latest
  • Count (Distinct)
  • Count

Boolean columns allow the following aggregations:

  • Count (Distinct)
  • Count
=================================================

Compare calculated columns with measures

Completed100 XP

DAX beginners often experience a degree of confusion about calculated columns and measures. The following section reviews the similarities and differences between both.

Regarding similarities between calculated columns and measures, both are:

  • Calculations that you can add to your data model.
  • Defined by using a DAX formula.
  • Referenced in DAX formulas by enclosing their names within square brackets.

The areas where calculated columns and measures differ include:

  • Purpose - Calculated columns extend a table with a new column, while measures define how to summarize model data.
  • Evaluation - Calculated columns are evaluated by using row context at data refresh time, while measures are evaluated by using filter context at query time. Filter context is introduced in a later module; it's an important topic to understand and master so that you can achieve complex summarizations.
  • Storage - Calculated columns (in Import storage mode tables) store a value for each row in the table, but a measure never stores values in the model.
  • Visual use - Calculated columns (like any column) can be used to filter, group, or summarize (as an implicit measure), whereas measures are designed to summarize.

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...