Forum Discussion
How can I calculate average for multiple columns?
- 4 years ago
Anonymous
pls see the attachment below
Anonymous
maybe you can try to unpivot those columns.
then you can get different average value by filter the Attribute value.
- Anonymous4 years agoNot 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_mayu4 years ago
Super User
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