Forum Discussion
Creating measure that will calculate a %
- Anonymous2 years ago
Hi EGM_Alycia ,
Are you referring to calculating the data after filtering and dividing it by the number of rows before filtering, you can consider using the Allselect() function that will calculate the data after filtering.
ALLSELECTED function (DAX) - DAX | Microsoft Learn
ALL function (DAX) - DAX | Microsoft Learn
Here are the steps you can follow:
1. Create measure.
Measure = var _sum= SUMX( ALLSELECTED('Table'),[Value]) var _count= COUNTX(ALL('Table'),'Table'[Group]) return DIVIDE( _sum,_count)2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi EGM_Alycia ,
Are you referring to calculating the data after filtering and dividing it by the number of rows before filtering, you can consider using the Allselect() function that will calculate the data after filtering.
ALLSELECTED function (DAX) - DAX | Microsoft Learn
ALL function (DAX) - DAX | Microsoft Learn
Here are the steps you can follow:
1. Create measure.
Measure =
var _sum=
SUMX(
ALLSELECTED('Table'),[Value])
var _count=
COUNTX(ALL('Table'),'Table'[Group])
return
DIVIDE(
_sum,_count)
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly