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
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
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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 community update carousel

Fabric Community Update - June 2025

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