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
alexamatthews
Regular Visitor

Calculate figures from one table as percentage of figures from another table

I have 2 tables; one give the quoted time to complete a certain activity, and the other is actual time spent on the same activity. The second table is live data from timesheets. They give a customer name, activity name, and number of hours spent/quoted for that activity. 

 

Time Quoted Table:

CustomerActivityHours
CompanyABuild20
CompanyATest10
CompanyBBuild40
CompanyBTest20
CompanyCBuild50
CompanyCTest30

 

Timesheet Table:

CustomerActivityHours
CompanyABuild5
CompanyABuild5
CompanyATest9
CompanyBTest10
CompanyBTest10

 

I have linked the tables and can compare the two side by side. Is it possible to give the time spent (table 2) as a percentage of the time quoted (table 1)?

In the second table, the same company/activity combination could appear more than once so it would need to be the sum of all relevant lines. For example, for the Build Phase for CustomerA, the time spent is 50% of the quoted time.

 

Thank you

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

Try

new column in Timesheet  = sumx(filter('Time Quoted','Time Quoted'[Customer]=Timesheet[Customer] 
	&& 'Time Quoted'[Activity]=Timesheet[Activity] ),'Time Quoted'[Hours])

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

Try

new column in Timesheet  = sumx(filter('Time Quoted','Time Quoted'[Customer]=Timesheet[Customer] 
	&& 'Time Quoted'[Activity]=Timesheet[Activity] ),'Time Quoted'[Hours])

Thank you @amitchandak it works! I changed the result slightly to give the result of time spent as percentage of the quoted amount, but otherwise does exactly what I needed 🙂

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.