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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

DAX for measure -Sum with condition

Hi PBI experts

I am unable to write DAX for below scenario. 

In given Data  table, measure to find out sum of qty where  at least one of Com typ is C for each ID

CompanyCom typPIDidQty.
Aothers128155285
CC1281552160
Aothers128155280
CC238299060
AOthers238299140
BOthers338299145
BOthers3223812138
CC322381232

 

Result- 555

Thanks 

3 REPLIES 3
Radhika2605
Helper II
Helper II

@amitchandak Sorry to tag you like that but saw your replies on various queries so thought you might be the right person. Any ideas about this one?

 

Thanks

Radhika

Anonymous
Not applicable

@Radhika2605 

Thanks for reply but this DAX will filter C and  sum of only those qty

 

 I need sum of all the rows (Qty) for IDs which have com typ as C. In above data except ID 382991 all others have C so, result as 555. 

 

Radhika2605
Helper II
Helper II

Hi @Anonymous,

 

You can use the following DAX function - 

Sum Of Quantity = CALCULATE( SUM ('Table'[Qty]), FILTER ('Table', 'Table'[Com typ]) = 'C' )

 

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

 

Thanks

Radhika

 

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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