Forum Discussion
Creating measure that will calculate a %
I am trying to build a new Measure that will take the filtered column and Divide by a total column. I am struggling with getting the filtered option to stay in my calculations.
Any help would be appreciated 🙂
- 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
2 Replies
- Ashish_Mathur
Super User
Hi,
Share data in a format that can be pasted in an MS Excel file and show the expected result.
- AnonymousNot applicable
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