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
BIuser45
Frequent Visitor

How to display one transaction amount per record ID?

I have a query that have a list of transaction in the fact table called Transaction in Power BI, which is simliar to the excel chart shown below. The same transaction might include different purchased beverages and would be dedicated for different events. The event is presented by an event id and that id is linked to a dimension table called Event. 

 

In transction ID 1, several alcohol were bought, but some are used for event 32 and the other were used for event 5. Because there are two event ID in the same transaction. Two of the same record of transaction amout and beverage type appears in the table. 

Transaction ID 2 should only have one transaction record, but because in the same transaction there were two types of beverages brought, so the record is seperated into two to show that juice and milk were purchased in the same transaction. This causes a problem when the total amount for all transaction is calculated. The total amount should be $125 instead of $240 that is shown in the chart. 

 

I only want to show one transaction amount per transaction ID, so that when I calculate the sum of transactions in the chart it should be $125 instead of $240. How would I do that? 

Transaction TableTransaction Table

 

Event TableEvent Table

 

3 REPLIES 3
rubayatyasmin
Super User
Super User

Hi, @BIuser45 

 

I was able to get the result using, summarize function. 

 

rubayatyasmin_0-1689658161018.png

used DAX: 

Total Unique TransId Amount =
SUMX(
    SUMMARIZE(
        Table1,
        Table1[TransId],
        "AmountPerTransId",
        MAX(Table1[amount])
    ),
    [AmountPerTransId]
)
 
rubayatyasmin_0-1689517080227.png

 


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


What is  "AmountPerTransId" and [AmountPerTransId]? I can find that variable in your table.

Hi, @BIuser45 

 

I am creating AmountPerTransId column here using the Summarize. and then using it as the 2nd argument for SUMX. Which then ultimately results 125. You can name it anything you want. If you name is MaxTransID, you will have to use [MaxTransID] as the 2nd argument for the SUMX func. 

 

here is the documentation for better understanding. 

 

SUMMARIZE function (DAX) - DAX | Microsoft Learn


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors