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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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