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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

SUM IF multiple measure conditions

Hi!

 

I am looking to display sales IF $ was spent on demos or samples. 

 

I've created a measure for both - 'demos' and 'samples' to be calculated and filtered based on GL acct. 

 

Although the calcuation does not work below - this is along the lines of what I am looking to create:

 

CALCULATE([Total Sales]), FILTER([demos] <> 0 || [samples] <> 0 )  

 

Christina_C_0-1680634318092.png

 

Any help would be greatly appreciated! 

 

Thank you! 

Christina

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@Anonymous Assuming that sales is something like SUM('Table'[Sales]) try:

Measure =
  SUMX(FILTER('Table', [demos] <> 0 || [samples] <> 0 ), SUM('Table'[Sales]) )


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...

View solution in original post

4 REPLIES 4
Greg_Deckler
Community Champion
Community Champion

@Anonymous Assuming that sales is something like SUM('Table'[Sales]) try:

Measure =
  SUMX(FILTER('Table', [demos] <> 0 || [samples] <> 0 ), SUM('Table'[Sales]) )


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...
Anonymous
Not applicable

Thank you, @Greg_Deckler !!

 

It worked using your example:

 

 

Sales = SUMX(FILTER(_Measures,[Demos] <> 0 || [Samples] <> 0 ), [Total Sales])

 

 

 

There are some customers that still show up as a zero under samples - do you know the easiest way to filter these out?

 

My DAX expression is:

 

 

Samples = CALCULATE([Total GL], 'GLEntry'[GL Account No] = "xxxxxx" )

 

Christina_C_1-1680642136992.png

 

 

 

 

Thanks again,

Christina

@Anonymous Just use the Filters pane and filter out where Sample = 0



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...
Anonymous
Not applicable

@Greg_Deckler  Oh right! of course...

 

I added OR Is Blank in the filter as well.

 

Thank YOU!!!

 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.