Forum Discussion
Emulating an array
- 6 years ago
DObiol add the following three measures and you will get it, breaking it down to easily understand everything, use the last measure in your visual
Sum Sales = SUM ( Mean[Sales] ) Sales Mean = DIVIDE ( CALCULATE ( [Sum Sales], ALL ( Mean[Month] ) ), CALCULATE ( DISTINCTCOUNT ( Mean[Month] ), ALL ( Mean[Month] ) ) ) Sales below Mean = SUMX ( SUMMARIZE ( Mean, Mean[Country], Mean[Month] ), IF ( [Sum Sales] < [Sales Mea], [Sum Sales] ) )I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
DObiol , Are these different measures
amitchandak , No, it's the same measure for all the cells. Just the sum of different values, containing month and concept.
- amitchandak6 years ago
Super User
DObiol , replace Measure and Avgmeasure with you correct measure and mean measure
Measure = sum(Table[Value])
Avgmeasure =calculate(average(Table[Value]),allexcept(Table,Table[concept]))Above Avg =
sumx(filter(summarize(Table, Table[concept], Table[Month],"_1",[Measure],"_2",[Avgmeasure]), [_1]<=[_2]),[_1])- DObiol6 years agoRegular Visitor
amitchandak Thanks for your response.
However, I think it is not working because Avgmeasure would calculate the average of each of the values containing a cell and a line, not the average of the sum.
In the example, for example cell containing "concept1" and "month 1" equals 5 as you can see.
sum of M 1 sum of M 2 sum of M 3 sum of M 4 sum of M 5 sum of M 6 Total Mean Concept 1 5 7 4 3 6 5 30 5,00 Concept 2 1 5 3 7 4 8 28 4,67 Concept 3 2 1 3 4 3 4 17 2,83 But in fact, the value "5" is the sum of other values, in this case "1+2+2".
So, when you calculate the mean, the formula will take into consideration the mean of 1, 2 and 2 for this cell, and the same for the other cells.
The idea is considering a cell as a value to operate, although in fact it is a sum of values. That's why I understand that this is similar to an array in other languages.
Thx!!
- amitchandak6 years ago
Super User
DObiol , share the data in raw format