Forum Discussion

Emmeli's avatar
Emmeli
Frequent Visitor
2 years ago
Solved

Create categorys with DAX

Hi 

I would love some help with a problem of mine. 

I have this data with the account and the sum column. I would like to create a "category" column with the help of DAX.

 

New column "category" Account sum
Stockholm 30100 1100
Stockholm 30106 45456
New York 30110 122354
New York 30112 565789
Stockholm 30113 764866
Stockholm 30120 1025033
Stockholm 30121 1285199
Stockholm 30122 1545366
Stockholm 30123 1805532
Stockholm 30124 2065699
Stockholm 30190 2065699
Stockholm 30199 565
Boston 30300 2065699
Boston 30310 1033132
Boston 30399 826618,4
Los Angeles 30400 620105,1
Los Angeles 30410 413591,7
Los Angeles 30499 207078,4
Florida 30500 565
Florida 30510 -205948
Florida 30520 -412462
Florida 30590 -618975
Florida 30599 -825488
New orleans 30800 -1032002
New orleans 30810 -1238515
New orleans 30820 -1445028
New orleans 30870 500
New orleans 30899 456
San Diego 31000 964127
San Diego 31001 1686869
San Diego 31010 2409611
San Diego 31011 3132354
San Diego 31020 3855096

 

So that I can use the category to create this

 

 

4 Replies

  • What would be the rules for the creation of this category?

    • Emmeli's avatar
      Emmeli
      Frequent Visitor

      I'm thinking something like this 

       

      Sum of "sum" column with accountnumber (30100-30106 and 30113-30199 )= Stockholm

      Sum of "sum" column with accountnumber 30110-30112 = New York

      Sum of "sum" column with accountnumber 30300-30399 = Boston

      Sum of "sum" column with accountnumber 30400-30499 = Los Angeles

      Sum of "sum" column with accountnumber 30500-30599 = Florida

      Sum of "sum" column with accountnumber 30800-30899 = New Orleans

      Sum of "sum" column with accountnumber 31000- 31020 = San Diego

       

      • lbendlin's avatar
        lbendlin
        Super User

        I'll show you two options.  One is using the existing data to create groups, the other is using a calculated column with the ranges.


         


         

         

  • Emmeli's avatar
    Emmeli
    Frequent Visitor

    Thank you for the help. Normaly I'm sure it would have worked but sadly I only have accec to a very limited data set which prevents me from adding colums. The only thing I can do is to create meassures.