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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

DAX syntax

Hi,

 

I'm trying to SUM a few variables, but I'm not sure how to write this in DAX.

 

Please take a look at my attached screenshots and you'll see what I am trying to do.  The screenshot with the question mark is my attempt at it, but it doesn't work.  Any pointers are appreciated, thank-you

 

this worksthis worksthis does not workthis does not work

1 ACCEPTED SOLUTION

With this sample table called 'fTable'
model.jpg

 

Try:

Sum A | C | D = 
CALCULATE([Sum Value], FILTER(fTable, fTable[Category] IN {"A", "C", "D"}))

which delivers the same result as:

Sum A + C + D = 
VAR _A = CALCULATE([Sum Value], FILTER(fTable, fTable[Category] = "A"))
VAR _C = CALCULATE([Sum Value], FILTER(fTable, fTable[Category] = "C"))
VAR _D = CALCULATE([Sum Value], FILTER(fTable, fTable[Category] = "D"))
RETURN
_A + _C + _D

result.jpg

 

 

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

4 REPLIES 4
Anonymous
Not applicable

thank-you.  Your syntax worked.  Here's how it looks now on my end:

 

DAXDAX

PaulDBrown
Community Champion
Community Champion

Are you trying to filter the table where the value meets all 3 conditions (so AND) or if the value meets one of the conditions (so OR)?





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Anonymous
Not applicable

yes, I want all 3 conditions (variables) included - AND.  I want all 3 summed up. Each variable has a numerical value, so if it's 3 + 4 + 9, then I want to see 16 total in the frontend.

 

In my other BI tool (Qlik Sense), the following syntax is used (& it works):

Sum({<[Activity]={'33-McDonalds_UK-thankyou - Appli_Submision','McDon_IE_ATS_ThankYou_Pg'}>}[Total Conversions])

 

this also works:  

 

Sum({<[Activity]={'Submitted_Application'}>}[Total Conversions])
+
Sum({<[Activity]={'UK_ATS_Submitted_Application'}>}[Total Conversions])
+
Sum({<[Activity]={'AU_ATS_Submitted_Application'}>}[Total Conversions])

 

but I can't find the correct way to write this in PowerBI DAX

With this sample table called 'fTable'
model.jpg

 

Try:

Sum A | C | D = 
CALCULATE([Sum Value], FILTER(fTable, fTable[Category] IN {"A", "C", "D"}))

which delivers the same result as:

Sum A + C + D = 
VAR _A = CALCULATE([Sum Value], FILTER(fTable, fTable[Category] = "A"))
VAR _C = CALCULATE([Sum Value], FILTER(fTable, fTable[Category] = "C"))
VAR _D = CALCULATE([Sum Value], FILTER(fTable, fTable[Category] = "D"))
RETURN
_A + _C + _D

result.jpg

 

 

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.