Forum Discussion
Summarize a Column Without Showing Total
- 8 years ago
Hi cbrandt,
I recommend using the HASONEVALUE() function to detect whether you are in a total contaxt in the definition of the measures used in your model.
Here is a link to an article that explains the concept:
https://powerpivotpro.com/2013/03/hasonevalue-vs-isfiltered-vs-hasonefilter/
- 8 years ago
Hi cbrandt
Your approach is slightly wrong. You should try ...
Measure = IF(HASONEVALUE(Table1[Quantity]), SUM(Table1[Quantity]), BLANK())
The formula can be read as ... If the total of values of the [Quantity] column of the Table1 is one then sum the quantity. If not then leave it BLANK.
In the totals there is no filter as in each of the rows of the visual you have placed. So ... it takes on account all of the values. Showing the total is prevented by using HASONEVALUE.
Hope That Helps
Vicente
Thanks for the help erik_tarnvik. I have tried this method but the results are the same as the original. Probably a mistake in my formula?
Measure = IF(HASONEVALUE(Table1[Quantity]), VALUES(Table1[Quantity]), SUM(Table1[Quantity]))
Hi cbrandt
Your approach is slightly wrong. You should try ...
Measure = IF(HASONEVALUE(Table1[Quantity]), SUM(Table1[Quantity]), BLANK())
The formula can be read as ... If the total of values of the [Quantity] column of the Table1 is one then sum the quantity. If not then leave it BLANK.
In the totals there is no filter as in each of the rows of the visual you have placed. So ... it takes on account all of the values. Showing the total is prevented by using HASONEVALUE.
Hope That Helps
Vicente