Forum Discussion
Calculating average based on different column.
- 2 years ago
var c = table_name[Customer] var s = table_name[salesperson] var g = table_name[group] var an = table_name[account number] return averagex ( filter( summarize( table_name, table_name[Customer], table_name[salesperson], table_name[group], table_name[account number], table_name[avg] ), table_name[Customer] = c && table_name[salesperson] = s && table_name[group] = g && table_name[account number] = an ), table_name[avg] )let me know if it works for you .
If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution ✅
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠Customer Salesperson Group account number avg Date
Hello Daniel29195,
Thank you for the reply.
I did removed the year but still it is showing me 19 is there anything that I should try. I tried removing each column and running it but no luck
- Daniel291952 years agoCommunity Champion
- Anonymous2 years agoNot applicable
Hi Nepal101 ,
I have a test by code as below.
My Code = CALCULATE ( AVERAGEX ( 'D-with dates', 'D-with dates'[Avg] ), ALLEXCEPT ( 'D-with dates', 'D-with dates'[Customer], 'D-with dates'[accountnumber], 'D-with dates'[group] ) )I create a measure and a calculated column to have a test.
I get the same result as Daniel29195, please share a sample with us, this will make it eaiser for us the find the solution.
You also can download my attatchment to compare my data model with yours.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.