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.
Hi!
I want to calculate a conditional average based on a measure, very similar to a question I already asked: https://community.powerbi.com/t5/Desktop/Calculate-conditional-average/m-p/1270531
This solution works fine, but this time I have a measure like this : Performance_Sum = COUNT(Table[Performance]), where Performance is a column with a few different values like "Calls", "Start Campagin", "Build Website" etc.
The above solution works perfectly fine for a measure with just one distinct value, but if apply this solution to the Performance_Sum measure I get the average for employees where the sum of Performance_Sum is greater than 1 but thats not what I want. So if an employee got 0 "Calls" but 3 "Start Campaign" he will be taken into account for the average of calls as well because "Performance_Sum" >1 but he should be excluded for the average of "Calls" and included for "Start Campaign".
I think I need to group by, but I dont really know who to apply this to the above solution.
Solved! Go to Solution.
@Anonymous , Not very clear.
But you need to have something like this
AverageX(filter(Summarize(Table, Table[employee], "_call" , [calls] ,"_ps" ,[Performance_Sum]),[_call] >0 && [_ps]>1),[_ps])
Hi @Anonymous,
I think summarize function should work for your scenario, can you please share some dummy data with the expected result to help us clarify your datastore and do test coding format on it?
How to Get Your Question Answered Quickly
In addition, you can also take a look at the following blog if you are processing the calculation on the subtotal level:
Clever Hierarchy Handling in DAX
Regards,
Xiaoxin Sheng
@Anonymous , Not very clear.
But you need to have something like this
AverageX(filter(Summarize(Table, Table[employee], "_call" , [calls] ,"_ps" ,[Performance_Sum]),[_call] >0 && [_ps]>1),[_ps])
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
93 | |
77 | |
65 | |
53 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |