Forum Discussion
How can I calculate average for multiple columns?
- 4 years ago
Anonymous
pls see the attachment below
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])
Anonymous
could you pls provide the sample data and expected output?
- Anonymous4 years agoNot applicable
Hi ryan_mayu ,
Not sure how to attach excel files as I don't see the option but I have shown a small subset of my data below. I want to create an average for all the value columns, i.e. value_00 and value_01. In my actual dataset this is about 60 columns so will be cumbersome to create a measure for every column.
TagName_00 DateTime_00 Value_00 TagName_01 DateTime_01 Value_01 xxxx 10/01/2022 12:30:00 20 yyyy 10/01/2022 12:30:00 40 xxxx 10/01/2022 13:30:00 30 yyyy 10/01/2022 13:30:00 60 - ryan_mayu4 years agoSuper User
Anonymous
you can select both value column and unpivot columns
if you have 60 value columns, you can select 60 columns and unpivot
then you can create a measure
average(value)
- Anonymous4 years agoNot applicable
Hi ryan_mayu ,
I was able to do this but not sure how I can filter this average by attribute. Where is the option located?