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
andy808
Helper II
Helper II

Trying to Divide into a Measure or Average it

I created 2 measures:

1 - # of Paid Days = CALCULATE(DISTINCTCOUNT(ASTimeEntry[TimeRecordedOnDate]),(FILTER('Date Table','Date Table'[IsWeekend] = False ))) + 0
 
2 - Sum of Tracked Hours = SUM(ASTimeEntry[TrackedHours]) +0
 
To get a %, I divided them:
Total Paid Hours % = [Sum of Tracked Hours] / [Total Paid Hours]
 
When I slice for 1 person it works (eg 100%). When I use it for the whole team (5 people) - it ADDS the %s (eg 500%). How do I average this %? Average FXN doesnt work, divide FXN by # of people doesnt work. Or is there a completely different formula I need to create?  HELP!
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@andy808 , make sure date does not have timestamp

 

or

 

try like

 

calculate( averageX(values(ASTimeEntry[TimeRecordedOnDate]), calculate(SUM(ASTimeEntry[TrackedHours]))),FILTER('Date Table','Date Table'[IsWeekend] = False()))

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@andy808 , make sure date does not have timestamp

 

or

 

try like

 

calculate( averageX(values(ASTimeEntry[TimeRecordedOnDate]), calculate(SUM(ASTimeEntry[TrackedHours]))),FILTER('Date Table','Date Table'[IsWeekend] = False()))

Thank you! I posted a new Q last night 2/28, could you look at it?

 

I am trying to get the % by dividing 1 result in a column over a TOTAL # from another column that is fixed/that doesnt get filtered except by Date slicer.

 

Right now I am getting 311/1328 (for a particular date range) which is the result I need:

andy808_0-1677683956851.png

The measure for Total Paid Hours ALL is: 

Total Paid Hours ALL = CALCULATE([Total Paid Hours], ALL())
-------------------------------------------------------------------------------- 
***Here is my [Total Paid Hours] measure which already has a filter = 
 = CALCULATE(DISTINCTCOUNT(ASTimeEntry[TimeRecordedOnDate]),(FILTER('Date Table','Date Table'[IsWeekend] = False ))) *8

 

But when I change my Date slicer the Total Paid Hours ALL is not changing.

andy808_1-1677684320836.png

 

 Appreciate any help here as soon as possible, thank you.

 

 

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.