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 there,
Im trying to create a measure that would show me the percentage of Attributes bellow the average value of all attributes (filterable by date slicers).
I understand this could be easily done by creating a calculated collumn, but due to performance impact I would like to prefer if this could be done using only one measure.
I've tried
but it's returning 0... 😕
Thanks in advance!
Solved! Go to Solution.
Hi @Anonymous ,
Pls test the below:
avarage2 = calculate(AVERAGE('Table'[Value]),ALL('Table'))
sum2 = CALCULATE( SUM('Table'[Value]),ALL('Table'))
countblewavg = CALCULATE(COUNT('Table'[Attribute]),FILTER(ALL('Table'),'Table'[Value]<=[avarage2]))
output result:
And if you need slicer in your table ,change all to allselected.
Did I answer your question? Mark my post as a solution!
Best Regards
Lucien
Hi @Anonymous ,
Pls test the below:
avarage2 = calculate(AVERAGE('Table'[Value]),ALL('Table'))
sum2 = CALCULATE( SUM('Table'[Value]),ALL('Table'))
countblewavg = CALCULATE(COUNT('Table'[Attribute]),FILTER(ALL('Table'),'Table'[Value]<=[avarage2]))
output result:
And if you need slicer in your table ,change all to allselected.
Did I answer your question? Mark my post as a solution!
Best Regards
Lucien
Hi agaia Parreirao2
Ha Ha. Think about it. They wont wont.
If you use SUM they the Total and Avergae will be the same as the Total Value for each row.
You need to wrap them in a calculate ALL to get the average and totals.
for example ....
Average Value =
CALCULATE(
Average(Table[Value]),
ALL()
)
Please click the thumbs up and accept as solution button 😀
I thought of that and tried it, it still showed me zero :S
Check images bellow:
Hi Parreirao2
You have not provided the DAX formulas for [Total Value] and [Average Value]. 😀
They're in the attached image 😛
But here they are again:
Average Value = Average(Table[Value])
Total Value = Sum(Table[Value]
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 |
---|---|
112 | |
100 | |
76 | |
74 | |
49 |
User | Count |
---|---|
146 | |
108 | |
106 | |
90 | |
62 |