Forum Discussion
Filtering on SUMMARIZECOLUMNS possible ?
Hi v-ljerr-msft
Sounds good. Internally we are only running december version, so i'll try and make a version on my own. One thing i noticed is that that the SUMMARIZECOLUMNS is running in the current date context.
Ex. if i have the following:
[Total Sales] = SUM('Sales'[Sales])
[Total Sales SPLY] = CALCULATE([Total Sales];SAMEPERIODLASTYEAR ('Date'[Date])))
[Total Sales Diff] = [Total Sales]-[Total Sales SPLY]
[Total Sales Diff%] = DIVIDE([Total Sales Diff];[Total Sales SPLY])
Measure 4 =
SUMX (
FILTER (
SUMMARIZECOLUMNS (
Locations[Country],
Products[Category],
"abc", [Total Sales Diff],
"efg", SUMX (Sales, [Total Sales Diff%] )
),
[efg] < 0.05
),
[abc]
)
So when in PowerBI selects Month= February 2018 it summarizes the combinations of Country and Category for [Total Sales] in February 2018, meaning that it will elave out the potential combinations of Country and Category for February 2017 (the SPLY measure used for the [Total Sales Diff] calcuation. In other words i don't get the [Total Sales Diff] for those combinations of Country and Category that were in February 2017 that was not in February 2018 - they are just left out of the SUMMARIZECOLUMNS.
In the current calculation i can solve it by using VALUES instead of SUMMARIZE, but it heavy on the ressources. Any idea of how to include that in the SUMMARIZECOLUMNS ?
Hi v-ljerr-msft
I did a little more testing and got latest PowerBI software on another machine.
The model is not a PowerBI model but a SSAS Tabular model running SQL Server 2017 CU4. I can create the measure without warnings and deloy it, but when connecting live from PowerBI (February 2018) i get the error:
Calculation error in measure 'Metrics'[Negative Churn v2 (12 Mth Compare)]: SummarizeColumns() and AddMissingItems() may not be used in this context.
I have send a Frown :-)