Forum Discussion
AVERAGEX with extra rows
- Anonymous2 years ago
Hi Noeleke1301 ,
We can create this measure.
Average with extra rows = var _count = [count measure] return AVERAGEX( UNION( SELECTCOLUMNS( Table1 , "Col1" , Table1[col1] ,"Pct" , Table1[Pct] ) , ADDCOLUMNS( GENERATESERIES( 0 , _count-1 ) , "Pct" , 0 ) ) , [Pct] )If the measure counts 2 occurences, the average of the table is 33.33%.
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Noeleke1301 ,
We can create this measure.
Average with extra rows =
var _count = [count measure]
return
AVERAGEX(
UNION(
SELECTCOLUMNS( Table1 , "Col1" , Table1[col1] ,"Pct" , Table1[Pct] ) ,
ADDCOLUMNS( GENERATESERIES( 0 , _count-1 ) , "Pct" , 0 ) ) ,
[Pct] )
If the measure counts 2 occurences, the average of the table is 33.33%.
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Noeleke13012 years agoHelper III
Awesome, thanks so much! Those tweaks you did made it work beautifully, exactly what I wanted.