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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Measure for Sum total using Line items

Hi I need help. Please!

 

I am trying to create a measure to give me the sum amount for each ID Number. Some items have many Line Item, while others have only 1.  Unfortunately the Amount field can be repeated due to the data structure. It should not be double counted since it is the same Line Item. This is where I am having issues with distinct functions and calculating the sum. Example is below.

 

Unfortunately the data is set up through a live connection so no calculated columns or tables can be made.

Any suggestions to calculate the total amount for each ID number? It would be great if the end result only appears once when placing this in a table, but I know thats a bit much.

 

Thanks!

ID NumberLine ItemAmount

Trans#

1251601
1252501
1253401
1254301
1255101
1251602
1257501
1258101
5261201
5262251
171101

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Try like

sumx(summarize(Table, Table[ID], Table[Number Line], Table[Item Amount]),[Item Amount])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
dax
Community Support
Community Support

Hi @Anonymous , 

You could refer to my sample for details.

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

amitchandak
Super User
Super User

@Anonymous , Try like

sumx(summarize(Table, Table[ID], Table[Number Line], Table[Item Amount]),[Item Amount])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
mahoneypat
Microsoft Employee
Microsoft Employee

Please try this expression to sum thd distinct list of numbers.  You can use it in a table visual with the ID numbers.

 

Sum Distinct = SUMX(VALUES('ID'[Amount]), 'ID'[Amount])
 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.