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´m having issue with the aggregated value of average.
the average value is calculated with all the underlying rows taken into account. I want it to discard 0 values.
underlying table:
my matrix:
I want this to show (2+6+5,5)/3 = 4,5 not 4,2 as this is currently calculating (0+3+4+6+8)/5 = 4,2
I want also this to discard the 0 value when I filter these valuse and display total average of 3:
any clever DAX suggestions? 🙂
Note: I´m not using any measures in this example and I select this option to aggregate:
Solved! Go to Solution.
Try creating the below measure:
Average = AVERAGEX(FILTER(Table1,Table1[Value] <>0),Table1[Value])
That does not work for my scenario as I might have another value in the table that does not have 0 and I want to display.
Example:
Then create a measure. Something simple like:
CALCULATE(AVERAGE(Table[Value]), Table[Value] <>0)
Try creating the below measure:
Average = AVERAGEX(FILTER(Table1,Table1[Value] <>0),Table1[Value])
@Omega, Thanks, This is exactly what I was looking for 🙂
I already created this DAX... but I had a feeling that there was some function for this:
MyAvg = CALCULATE(SUM(Table1[Value])/COUNTROWS(Table1);FILTER(Table1;Table1[Value] <> 0))
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 |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |