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

Calculating a percent using two measures

Hello,

 

I am working on an employee metrics chart and I cannot seem to get the productivity % calculation to work out

 

I have a few measures and i'm trying to create another measure to divide two of them: 

TimeSpent = calculate(sumx(UserStats, UserStats[Completed])*sumx(Tasks, Tasks[TaskTime])/60)
TimeSpent2 = sumx(UserStats, [TimeSpent])
ExpTime = sum(UserStats[Completed])
ExpTime2 = [ExpTime]*.875
 
I need to come up with a formula showing 
TimeSpent2/ExpTime2= Productivity %
 
For an example, in my case the values are as follows
 
TimeSpent2= 133.07
ExpTime2= 144.09
 
The result i'm expecting is 133.07/144.09=92.35%
 
What i'm getting is:
Pcent = divide([TimeSpent2],[ExpTime2])= 18.51%
 
I should also mention there are filters and slicers on my page. 
 
I'm not sure how to do this calculation correctly- any thoughts?

 

1 REPLY 1
v-chuncz-msft
Community Support
Community Support

@slan2018 ,

 

You may try Table visual to check the result and modify the context.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.