Forum Discussion
Exclude particular row in total
- 7 years ago
Hi Anonymous
Try this measure
SpoilerMeasure = IF ( HASONEFILTER ( 'Table'[Year] ), SUM ( 'Table'[Amount] ), SUMX ( FILTER ( VALUES ( Table[Year] ), 'Table'[Year] <> "Year1" ), CALCULATE ( SUM ( 'Table'[Amount] ) ) ) )
Zubair_Muhammad It worked!! Can you explain a little for me please?
I am trying to piece together how each formula works. Individually, I kinda understand, but putting them together seems a bit confusing... Sorry..
Sure Anonymous
The formulas like HASONEFILTER,HASONEVALUE,ISFILTERED are useful in detecting totals and specifying different calculations for them.
The total row contains all the years you have selected
Here is a very good article
https://powerpivotpro.com/2013/03/hasonevalue-vs-isfiltered-vs-hasonefilter/.
So in the if clause we apply the normal sum(sales) calculation if the YEAR row contains a single year.
In the totalrow we sum the sales of all the years (excluding an year) using an interator function SUMX