Forum Discussion
Average Calculations
- Anonymous6 years ago
Thanks, that has worked well other than I have ran into an issue. I need to be able to filter by program and get the average hours on the program. I have tried to do this with a slicer. It changes everything bar the cumulative count of clients, which then impacts the average hours. What can I put in the measure to be able to take into account of this?
For example Customers 1-4 maybe in Program A and 5-7 maybe in Program B and so on.
Thanks
Hi Anonymous ,
Why don't you mark this as solved so that others may find it. You could then repost your latest question as a new question. I will probably be off line for a couple of days. This gives others a chance to jump in answer. If you decide not to, I will look at this when I get back on line.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel
Hi Anonymous ,
We had to add a filter for aver[Program] changing the ALL() to ALLEXCEPT(). Here is the updated PBIX. Average
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel
Total Cumulative hours =
VAR MaxDate = MAX ( aver[Date] )-- Saves the last visible date
var Hours =
CALCULATE (
[Total Hours measure], -- Computes hours
aver[Date]<= MaxDate, -- Where date is before the last visible date
ALLEXCEPT( aver,aver[Program] ) -- Removes any other filters from Date allexcept aver[Program]
)
return Hours
-------------------------------------
Cumulative Count of Customers =
VAR MaxDate = MAX ( aver[Date] )-- Saves the last visible date
var Counter =
CALCULATE (
[Count of customers], -- Computes customers
aver[Date]<= MaxDate, -- Where date is before the last visible date
ALLEXCEPT( aver,aver[Program] ) -- Removes any other filters from Date allexcept aver([Program]
)
return Counter