Forum Discussion

Emmett52's avatar
Emmett52
Frequent Visitor
3 years ago

Sumif output based on Column not present in Visual

Hi,

 

Is it possible to create a dax measure which outputs the result of the SUM of SUMIFS of columns not present in a visual?
Example, suppose I have a table with Region, Country, Brand and Product as attribute columns along with Total Revenue and Volume.

I wish to calculate the sumifs for Region, Country, Brand even though Brand will be the only attribute column added to the visual  (in excel, this would be the SUMIFS([Revenue],[Region],[@[Region]],[Country],[@[Country]],[Brand],[@[Brand]])
(Basically, sales Mix calculation requirements)


Please try to ignore your first immediate question "why are you trying to do this?!! as above is a very simplified version of my needs which i will / should be able to scale to meet requirements.  

(also, of course each Country will only be assigned to 1 x region, but i'm only trying to understand if request is possible and so i'm keeping the data simple for my understanding of any suggested result!!)

I can currently achieve desired output using a lot (ALOT) of calculated columns (eg below), but the report is in no way dynamic.

Pack_NSRUC = 
VAR NSR = 
DIVIDE(
    CALCULATE(
                    SUM( DATA[NSR_Comp] ), 
                    FILTER( 
                        ALL( DATA ), 
                        DATA[Country] = SELECTEDVALUE( DATA[Country] ) 
                        && DATA[Channel] = SELECTEDVALUE( DATA[Channel])
                        && DATA[CPL] = SELECTEDVALUE( DATA[CPL])
                        && DATA[Brand] = SELECTEDVALUE( DATA[Brand])
                        && DATA[Brand Group] = SELECTEDVALUE( DATA[Brand Group])  ) ),
    CALCULATE(
                    SUM( DATA[Volume UC_Comp] ), 
                    FILTER( 
                        ALL( DATA ), 
                        DATA[Country] = SELECTEDVALUE( DATA[Country] ) 
                        && DATA[Channel] = SELECTEDVALUE( DATA[Channel])
                        && DATA[CPL] = SELECTEDVALUE( DATA[CPL])
                        && DATA[Brand] = SELECTEDVALUE( DATA[Brand])
                        && DATA[Brand Group] = SELECTEDVALUE( DATA[Brand Group])) ))

RETURN NSR



Thank you in advance for any suggestions or help!

3 Replies