Forum Discussion

Sabo256w's avatar
Sabo256w
Frequent Visitor
4 years ago
Solved

Basic Filter Grouping Help

Hi All,    I have a basic issue that I can't seem to figure out.    I want to create "groups" of amounts: 0-100k, 100 - 500k etc, for my budgets.    I have done this by creating a conditional c...
  • wdx223_Daniel's avatar
    4 years ago

    your M code just classified categories row by row, this is not what you really wanted.

    say, one sub-category's amount is 90k, then cost level will be 0-100k, if there are 100 rows of this sub-category, then the sum amount will be 9000k, but it always be cagegoried to 0-100k.

     

    you can create a dimension table to define each cost level's up and low limited, say

    cost level      min      max

    0-100k            0          100

    .........

    then create measure like:

    NewMeasure=sumx(filter(values(table[sub-category]), var _amt=calculate(sum(facttable[amount])) return _amt>=max(dimcostleveltable[min])&&_amt<=max(dimcostleveltable[max])),calculate(sum(facttable[amount])))