Dynamic SUMX Total in PowerBI

Viewed 514

I have a similar problem as discussed in this article (https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907 ;sharing this as the explanation is good and the data is available), but for me I have 15 variable vs 3 shown in the article.

Is there a way to dynamically calculate the Summarize and SUMX based on the variables used in the Matrix. E.g. When Name and Category1 is in the Matrix, the measure would summarize the table on Name and Category1 and calculate SUMX; when Category2 and Category1 is in the Matrix, the measure would summarize the table on Category2 and Category1 and calculate SUMX; and so on.

So I my case, I can put in any of the 15 variables I have and achieve the result with just 1 measure. Nested IF would not work because I would have 15! combinations.

1 Answers

Hi this is a classic example for Calculation Groups create a calculation group and create 15 variables with summarization for each column, because dynamic group by is not available at the moment.

with each measure containing sumx for the necessary columns.

use SELECTEDMEASURENAME() to get the measure name and switch in-between each return.

Related