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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
acnt_schartner
Helper III
Helper III

Combine Costs of Project and Subproject

Hello,

 

i have the following table:

Project_NumberCosts
100001250000
100002230000
100002235000

 

The 6 digit Project_Numbers are our usual projects. There are subprojects that just get an extra added number to the Project_Number (7 digits). We invoice a total amount for project and subproject and i want to compare the costs to the earnings (the subproject dont have earnings and the main-project has the earnings of both). Is there a way to create a column that sums the cost of the project and the subprojects like this?

 

Project_NumberCostsSUM_Costs
100001200000200000
100002180000215000
1000022350000

 

Thanks in advance.

 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@acnt_schartner 

please try this

Column = 
if(LEN('table'[Project_Number])=7,0,SUMX(FILTER('table',left('table'[Project_Number],6)=LEFT(EARLIER('table'[Project_Number]),6)),'table'[Costs]))

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
harshnathani
Community Champion
Community Champion

Hi @acnt_schartner ,

 

 

Split your project number and sub number in Power Query.

 

1.jpg

 

 

You can then create a measure

 

Measure_ ProjectSUM = SUM('Table'[Costs])

 

2.JPG

 

 

Regards,

Harsh Nathani


Appreciate with a Kudos!! (Click the Thumbs Up Button)

Did I answer your question? Mark my post as a solution!

ryan_mayu
Super User
Super User

@acnt_schartner 

please try this

Column = 
if(LEN('table'[Project_Number])=7,0,SUMX(FILTER('table',left('table'[Project_Number],6)=LEFT(EARLIER('table'[Project_Number]),6)),'table'[Costs]))

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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