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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors