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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
ktbam_7
New Member

Line Item sum for unique label

Hello,

 

I have below sample data and need a measure to calculate a sum of each unique package label based on the individual package IDs:

 

Package LabelPackage IDLine Item Cost
455571110$995.95
455571118$493.00
455571119$948.05

 

I need an outcome like this:

 

Package LabelPackage IDLine Item CostTotal Package Cost
455571110$995.95$2,437.00
455571118$493.00$2,437.00
455571119$948.05$2,437.00

 

I have tried the below in DAX, but the measure just returns the line item cost again:

 

Unique Package Label Costs = SUMX(VALUES('table'[package label]),CALCULATE(SUM('table'[line item cost])))
Unique Package Lable Costs = SUMX(DISTINCT('table'[package label]),CALCULATE(SUM('table'[line item cost])))

 

Thanks,

Alex

 

 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1727888741431.png

 

 

Total package cost: =
CALCULATE (
    SUM ( 'table'[Line Item Cost] ),
    ALLEXCEPT ( 'table', 'table'[Package Label] )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

4 REPLIES 4
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1727888741431.png

 

 

Total package cost: =
CALCULATE (
    SUM ( 'table'[Line Item Cost] ),
    ALLEXCEPT ( 'table', 'table'[Package Label] )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

This worked. Thank you!

powerbiexpert22
Impactful Individual
Impactful Individual

Hi @ktbam_7 

please try below

 

CALCULATE(SUM(table[Line Item Cost]),FILTER(All(table),
table[Package Label]=MAX(table[Package Label])))

This worked as well! Thank you.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.