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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
ddoshi
New Member

How to sum revenue from all associated transactions

Thanks for your help in advance.

 

Data: 

 

Job#LineItemType              Car Number                Crew Member       Revenue  Cost
1000Labour Tom1000500
1000Labour Richard20001200
1000MaterialsA 20001000
1000MaterialsB 25001000
1000Credit Memo  -5000
1001Labour Harry500250
1001MaterialsC 1000

500

 

 

Desired output 1: 

 

 Total revenue for all crew in related jobsTotal revenue associated jobs
Tom30007500
Richard30007500
Harry5001500

 

Desired output 2:

 

 Total revenue for all cars in related jobsTotal revenue associated jobs
Car A45007500
Car B45007500
Car C10001500

 

I am running into difficulties on how to calculate these sums because the fact-table doesn't have each crew or each car that is associated with each job on every row. Any thoughts on how to address this would be greatly appreciated!

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

wdx223_Daniel_0-1614136357318.png

Total revenue associated jobs = IF(SELECTEDVALUE('Table'[Crew Member])<>"",CALCULATE(SUM('Table'[Revenue]),VALUES('Table'[Job#]),ALL('Table'[Crew Member]),'Table'[LineItemType]<>"Credit Memo"))

Total revenue associated jobs car = IF(SELECTEDVALUE('Table'[Car Number])<>"",CALCULATE(SUM('Table'[Revenue]),VALUES('Table'[Job#]),ALL('Table'[Car Number]),'Table'[LineItemType]<>"Credit Memo"))

Total revenue for all cars in related jobs = IF(SELECTEDVALUE('Table'[Car Number])<>"",CALCULATE(SUM('Table'[Revenue]),VALUES('Table'[Job#]),'Table'[Car Number]<>""))

Total revenue for all cars in related jobs = IF(SELECTEDVALUE('Table'[Car Number])<>"",CALCULATE(SUM('Table'[Revenue]),VALUES('Table'[Job#]),'Table'[Car Number]<>""))

 

 

 

 

 

 

View solution in original post

1 REPLY 1
wdx223_Daniel
Super User
Super User

wdx223_Daniel_0-1614136357318.png

Total revenue associated jobs = IF(SELECTEDVALUE('Table'[Crew Member])<>"",CALCULATE(SUM('Table'[Revenue]),VALUES('Table'[Job#]),ALL('Table'[Crew Member]),'Table'[LineItemType]<>"Credit Memo"))

Total revenue associated jobs car = IF(SELECTEDVALUE('Table'[Car Number])<>"",CALCULATE(SUM('Table'[Revenue]),VALUES('Table'[Job#]),ALL('Table'[Car Number]),'Table'[LineItemType]<>"Credit Memo"))

Total revenue for all cars in related jobs = IF(SELECTEDVALUE('Table'[Car Number])<>"",CALCULATE(SUM('Table'[Revenue]),VALUES('Table'[Job#]),'Table'[Car Number]<>""))

Total revenue for all cars in related jobs = IF(SELECTEDVALUE('Table'[Car Number])<>"",CALCULATE(SUM('Table'[Revenue]),VALUES('Table'[Job#]),'Table'[Car Number]<>""))

 

 

 

 

 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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