Forum Discussion
How can I calculate average for multiple columns?
I have 100+ columns and need an average for each one but don't want to create 100+ measures to compute the average for each one. Is there a faster way to do this, e.g. can I make just one measure and calculate an average for every column inside it?
Anonymous
pls see the attachment below
9 Replies
- ryan_mayu
Super User
Anonymous
maybe you can try to unpivot those columns.
then you can get different average value by filter the Attribute value.
- AnonymousNot applicable
Thanks ryan_mayu
I've unpivoted the columns but not sure how I can filter the average by attribute value. I created a measure from the unpivoted column using the below code but this gives an average for all the different columns combined. How do i filter this by attribute now?
average = sum(table[value])/count(table[value])- ryan_mayu
Super User
Anonymous
could you pls provide the sample data and expected output?