Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
ajay_gajree
Helper I
Helper I

SUMMARIZECOLUMNS WITH FILTER

Hi All

 

How can I amend the following DAX Table Code to filter the Sentiment Column for the value Positive only? I am able to retrieve it as a column from the 01_Data_v0 1Dashboard table, but I can't work out how to only bring in rows with the value Positive?

 

BenefitAgg Sentiment =
SUMMARIZECOLUMNS (
'01_Data_v0 1Dashboard'[Brand],
'01_Data_v0 1Dashboard'[Quarter],
'01_Data_v0 1Dashboard'[Market],
'01_Data_v0 1Dashboard'[Sentiment],
"Count", COUNTROWS ( '01_Data_v0 1Dashboard' ),
"Functional", SUM ( '01_Data_v0 1Dashboard'[Good Design] )
+ SUM ( '01_Data_v0 1Dashboard'[Battery Longevity] )
+ SUM ( '01_Data_v0 1Dashboard'[Ease of Use] )
+ SUM ( '01_Data_v0 1Dashboard'[Easily Available] )
+ SUM ( '01_Data_v0 1Dashboard'[No Smell] )
+ SUM ( '01_Data_v0 1Dashboard'[Quality] )
+ SUM ( '01_Data_v0 1Dashboard'[Less Harm] )
+ SUM ( '01_Data_v0 1Dashboard'[Value for Money] )
+ SUM ( '01_Data_v0 1Dashboard'[Nicotine Satisfaction] )
+ SUM ( '01_Data_v0 1Dashboard'[Flavour] ),
"Emotional", SUM ( '01_Data_v0 1Dashboard'[Healthier Lifestyle] )
+ SUM ( '01_Data_v0 1Dashboard'[Feeling Cool] )
+ SUM ( '01_Data_v0 1Dashboard'[Shared Moments] )
+ SUM ( '01_Data_v0 1Dashboard'[Relaxation] )
+ SUM ( '01_Data_v0 1Dashboard'[Modern/Innovative] )
+ SUM ( '01_Data_v0 1Dashboard'[Cool/Stylish] )
+ SUM ( '01_Data_v0 1Dashboard'[Customisation] ),
"CurrentSeason", MAX ( '01_Data_v0 1Dashboard'[IsCurrentQuarter] ),
"PreviousSeason", MAX ( '01_Data_v0 1Dashboard'[IsPreviousQuarter] ),
"QuarterSort", MAX ( '01_Data_v0 1Dashboard'[Quartersort] )
)
2 REPLIES 2
Anonymous
Not applicable

The measures under SUMMARIZECOLUMNS would be sooooooo much simpler if you unpivoted the table... This is actually what should be done in the first place.

Please remember that fact tables should be long but narrow, dimensions should be short but possibly wide.

Best
D

Greg_Deckler
Community Champion
Community Champion

I think you need to use the filterTable parameter:

https://docs.microsoft.com/en-us/dax/summarizecolumns-function-dax

 

BenefitAgg Sentiment =
SUMMARIZECOLUMNS (
'01_Data_v0 1Dashboard'[Brand],
'01_Data_v0 1Dashboard'[Quarter],
'01_Data_v0 1Dashboard'[Market],
'01_Data_v0 1Dashboard'[Sentiment],
FILTER('01_Data_v0 1Dashboard',< your filter goes here>),
"Count", COUNTROWS ( '01_Data_v0 1Dashboard' ),
"Functional", SUM ( '01_Data_v0 1Dashboard'[Good Design] )
+ SUM ( '01_Data_v0 1Dashboard'[Battery Longevity] )
+ SUM ( '01_Data_v0 1Dashboard'[Ease of Use] )
+ SUM ( '01_Data_v0 1Dashboard'[Easily Available] )
+ SUM ( '01_Data_v0 1Dashboard'[No Smell] )
+ SUM ( '01_Data_v0 1Dashboard'[Quality] )
+ SUM ( '01_Data_v0 1Dashboard'[Less Harm] )
+ SUM ( '01_Data_v0 1Dashboard'[Value for Money] )
+ SUM ( '01_Data_v0 1Dashboard'[Nicotine Satisfaction] )
+ SUM ( '01_Data_v0 1Dashboard'[Flavour] ),
"Emotional", SUM ( '01_Data_v0 1Dashboard'[Healthier Lifestyle] )
+ SUM ( '01_Data_v0 1Dashboard'[Feeling Cool] )
+ SUM ( '01_Data_v0 1Dashboard'[Shared Moments] )
+ SUM ( '01_Data_v0 1Dashboard'[Relaxation] )
+ SUM ( '01_Data_v0 1Dashboard'[Modern/Innovative] )
+ SUM ( '01_Data_v0 1Dashboard'[Cool/Stylish] )
+ SUM ( '01_Data_v0 1Dashboard'[Customisation] ),
"CurrentSeason", MAX ( '01_Data_v0 1Dashboard'[IsCurrentQuarter] ),
"PreviousSeason", MAX ( '01_Data_v0 1Dashboard'[IsPreviousQuarter] ),
"QuarterSort", MAX ( '01_Data_v0 1Dashboard'[Quartersort] )
)


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.