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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
sivarajan21
Post Partisan
Post Partisan

Dax to sum a value column based on two filters

Hi,

 

I have the below table :

sivarajan21_0-1693473242269.png

I need to sum the value column with respect to TargetType =0 and their corresponding Value Type.

My dax takes is as below:

Target Unit =
CALCULATE (
SUMX ( Target, Target[Value] ),
FILTER ( Target, Target[TargetType] = 0 )
)

 

This dax takes into consideration TargetType =0 but not Value Type. I have multiple Value Type such as Value_03,Value_02,Value_01 upto Value_12.

 

Could you please help me?

PFA raw excel file test.xlsx

Please let me know if you need further info!

 

Thanks in advance!

@Ahmedx @Greg_Deckler @grantsamborn @amitchandak @Sergii24 

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

plse thr this

CALCULATE (
SUMX ( Target, Target[Value] ),
Target, Target[TargetType] = 0 && Target[Value Type] in {"Value_01","Value_02","Value_3","Value_12" } )

View solution in original post

3 REPLIES 3
sivarajan21
Post Partisan
Post Partisan

Hi Sir,

 

I have accepted it as a solution!

Thank you!

 

Ahmedx
Super User
Super User

plse thr this

CALCULATE (
SUMX ( Target, Target[Value] ),
Target, Target[TargetType] = 0 && Target[Value Type] in {"Value_01","Value_02","Value_3","Value_12" } )

Hi @Ahmedx ,

 

Amazing solution! thanks,

I will have a look and get back sir

 

Thanks

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.