

"PY QTD", CALCULATE (, 'Time Intelligence' = "PY QTD" ), "PY", CALCULATE (, 'Time Intelligence' = "PY" ), "YTD", CALCULATE (, 'Time Intelligence' = "YTD" ), "QTD", CALCULATE (, 'Time Intelligence' = "QTD" ), "Current", CALCULATE (, 'Time Intelligence' = "Current" ),

Note: YOY and YOY% are omitted from this query example. To test this calculation group, execute a DAX query in SSMS or the open-source DAX Studio. PY CALCULATE(SELECTEDMEASURE(), SAMEPERIODLASTYEAR(DimDate)) YTD CALCULATE(SELECTEDMEASURE(), DATESYTD(DimDate)) QTD CALCULATE(SELECTEDMEASURE(), DATESQTD(DimDate)) MTD CALCULATE(SELECTEDMEASURE(), DATESMTD(DimDate)) Precedence - 20 Time Intelligence calculation items SELECTEDMEASUREFORMATSTRING - Used by expressions for calculation items to retrieve the format string of the measure that is in context. ISSELECTEDMEASURE - Used by expressions for calculation items to determine the measure that is in context is specified in a list of measures. SELECTEDMEASURENAME - Used by expressions for calculation items to determine the measure that is in context by name. SELECTEDMEASURE - Used by expressions for calculation items to reference the measure that is currently in context. Now that you've seen how calculation groups benefit users, let's take a look at how the Time Intelligence calculation group example shown is created.īefore we go into the details, let's introduce some new DAX functions specifically for calculation groups:
HOW TO CREATE FILTER GROUPS IN COLOR FINALE PRO FULL
This means, Microsoft Excel users, which query tabular data models by using MDX, can take full advantage of calculation groups in worksheet PivotTables and charts. When set to true, Power BI Desktop in Live Connect mode disables creation of implicit measures.Ĭalculation groups also support Multidimensional Data Expressions (MDX) queries. Currently, in order to create calculation groups this property must be set to true. A new model property visible in the Tabular Object Model (TOM) has been introduced, DiscourageImplicitMeasures. At this time, Power BI generates DAX for implicit measures written as inline DAX calculations - meaning implicit measures cannot work with calculation groups. For example, in Power BI implicit measures are created when a user drags columns onto visuals to view aggregated values, without creating an explicit measure. Calculation groups do not work with implicit DAX measures. In this example, Sales is an explicit measure already created in the model.

Values for each row are calculated from the base measure, Sales.Ĭalculation groups work with explicit DAX measures. With a calculation group, in this example named Time Intelligence, when the user drags the Time Calculation item to the Columns filter area, each calculation item appears as a separate column. Without calculation groups, the user would have to select individual time intelligence measures. The user then wants to apply time intelligence calculations to get sales totals for month to date, quarter to date, year to date, and so on. Before applying a calculation group, the common base measure Sales calculates a sum of total sales for each month. In the following animation, a user is analyzing sales data for years 20. The column isn't like a typical column or dimension, instead it represents one or more reusable calculations, or calculation items that can be applied to any measure already added to the Values filter for a visualization. We'll then take a look at what makes up a calculation group, and how they're created in a model.Ĭalculation groups are shown in reporting clients as a table with a single column.

Let's first take a look at how calculation groups appear to users in a reporting tool like Power BI. For the user, this can mean having to sort through just as many measures, and apply them individually to their report. The data modeler has to create separate measures for each calculation, which can lead to dozens of measures. For example, a sales analyst wants to view sales totals and orders by month-to-date (MTD), quarter-to-date (QTD), year-to-date (YTD), orders year-to-date for the previous year (PY), and so on. This website is managed on a digital platform of the National Football League.Calculation groups address an issue in complex models where there can be a proliferation of redundant measures using the same calculations - most common with time intelligence calculations.
