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 August 31st. Request your voucher.

Reply
MHatMFT
Frequent Visitor

Find value of all transactions that have specific codes

I have a dataset of all sales order items using the format below. I would like to create a measure that returns the value of all orders that contain C1. It must include the values of all items on the order, not just C1. How would I go about this?

 

OrderNoCodeQtySubtotal
Ord1C1110.00
Ord1C2315.00
Ord2C1220.00
Ord2C339.00
Ord 3C2420.00
Ord3C313.00

 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You could use

C1 Sales =
VAR C1Orders =
    CALCULATETABLE ( VALUES ( Sales[Order no] ), Sales[Code] = "C1" )
VAR Result =
    CALCULATE ( SUM ( Sales[Subtotal] ), C1Orders )
RETURN
    Result

View solution in original post

1 REPLY 1
johnt75
Super User
Super User

You could use

C1 Sales =
VAR C1Orders =
    CALCULATETABLE ( VALUES ( Sales[Order no] ), Sales[Code] = "C1" )
VAR Result =
    CALCULATE ( SUM ( Sales[Subtotal] ), C1Orders )
RETURN
    Result

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.