Forum Discussion
Limiting Rows in Matrix Table is not Subtotaling
- 2 years ago
This was the closest answer to get me to figure it out.
The actual answer is
VAR included_manufacturer = if( AND( SELECTEDVALUE('Product'[Manufacturer]) in VALUES('Category Competing Manufacturers'[Manufacturer]), SELECTEDVALUE('Product'[Category]) IN VALUES('Category Competing Manufacturers'[Category])) , 1 , BLANK() ) RETURN IF( sumx('Product',[included_manufacturer]) > 0 , [Total Dollar Sales] , BLANK() )But yes, the trick is for it to roll up to the subtotals we need it to be a sum, or some calculation that allows the subtotal lines to still calculate their totals.
So this final formula gives the included manufacturers a value of 1 and all other manufacturers a blank value. Then anywhere the sum of the included manufacturers is greater than 0 we can insert the Total Dollar Sales, so this means that the logic statement is TRUE for both the included manufacturers as well as the higher subtotal levels that could have sums of 2 or more.
dg123456789 try this:
Total Dollar Sales (Filtered) =
SUMX (
FILTER (
VALUES ( 'Product'[Manufacturer],
'Product'[Manufacturer] IN VALUES('Category Competing Manufacturers'[Manufacturer])
)
, [Total Dollar Sales]
)This was the closest answer to get me to figure it out.
The actual answer is
VAR included_manufacturer =
if(
AND(
SELECTEDVALUE('Product'[Manufacturer]) in VALUES('Category Competing Manufacturers'[Manufacturer]),
SELECTEDVALUE('Product'[Category]) IN VALUES('Category Competing Manufacturers'[Category]))
, 1
, BLANK()
)
RETURN
IF(
sumx('Product',[included_manufacturer]) > 0
, [Total Dollar Sales]
, BLANK()
)
But yes, the trick is for it to roll up to the subtotals we need it to be a sum, or some calculation that allows the subtotal lines to still calculate their totals.
So this final formula gives the included manufacturers a value of 1 and all other manufacturers a blank value. Then anywhere the sum of the included manufacturers is greater than 0 we can insert the Total Dollar Sales, so this means that the logic statement is TRUE for both the included manufacturers as well as the higher subtotal levels that could have sums of 2 or more.