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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

DAX for sum with multiple where conditions

Hello,

 

I am trying to write a DAX for sum of multiple where conditions. For ex:

CALCULATE(SUM(W_R[T]),W_R[S] = "C" || W_R[S] = "C_S" || W_R[S]  = "R" || W_R[S] = "V").  The DAX is running but it's not showing me the correct number. Can some one please tell me where I am wrong?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Anonymous ,

I created some data:

vyangliumsft_0-1653979002952.png

If you want to put measure and other fields together, you need to add an all()

Create measure.

add_all = CALCULATE(SUM(W_R[T]),FILTER(ALL(W_R), W_R[S] = "C" || W_R[S] = "C_S" || W_R[S]  = "R" || W_R[S] = "V"))

vyangliumsft_1-1653979002953.png

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi  @Anonymous ,

I created some data:

vyangliumsft_0-1653979002952.png

If you want to put measure and other fields together, you need to add an all()

Create measure.

add_all = CALCULATE(SUM(W_R[T]),FILTER(ALL(W_R), W_R[S] = "C" || W_R[S] = "C_S" || W_R[S]  = "R" || W_R[S] = "V"))

vyangliumsft_1-1653979002953.png

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Fowmy
Super User
Super User

@Anonymous 
Please provide more details and explain your data and the expcted results

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.

Top Solution Authors
Top Kudoed Authors