Forum Discussion

DObiol's avatar
DObiol
Regular Visitor
6 years ago
Solved

Emulating an array

Hi!!!

 

I need some help!

I have a trouble in many dashboards creating a measure that emulates an array.

 

For eample, imagine we have a table like the following, where each value of the cells is in fact a sum of values. This is very important because if each value you see was just one value, the problem would be easy to fix.

 

 sum of M 1sum of M 2sum of M 3sum of M 4sum of M 5sum of M 6TotalMean
Concept 1574365305,00
Concept 2153748284,67
Concept 3213434172,83

 

As you can see, the Total column shows the sum of each line. 

But what if what I want to do is to sum only the cells where the sum is below the mean.

For example, if in concept 1 the sum of Mont 2 is 7, this value has to disappear from the list.

 

The result should be as follows.

 sum of M 1sum of M 2sum of M 3sum of M 4sum of M 5sum of M 6Total
Concept 15 43 517
Concept 21 3 4 8
Concept 321    3

 

As you can see, the new Total excludes cells where the sum (not the values) is over the mean.

 

Thanks for your responses!!!

  • 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!

9 Replies

    • DObiol's avatar
      DObiol
      Regular Visitor

      amitchandak , No, it's the same measure for all the cells. Just the sum of different values, containing month and concept.

      • amitchandak's avatar
        amitchandak
        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])