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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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