Forum Discussion

ola1996's avatar
ola1996
Icon for Helper I rankHelper I
6 years ago
Solved

DAX formula for new columns with groups

Hi,

I need help a lot. I have one column in my database, which consist of numbers and text: 

I want to create new 2 columns which grouped this values by tens and hundreds, e.g. for 122 is in groupe 100 and 120. 

 


What I done by now: 

 

1. I divided the column to keep the number without text

2. I try to create calculated column, like that 

HundredsRange =
IF (
[Code — kopia.2] >= 100
&& [Code — kopia.2]<=199,
"100";
IF (
[Code — kopia.2] >= 200
&& [Code — kopia.2] <= 299,
"200";
IF (
[Code — kopia.2] >= 300
&& [Code — kopia.2] <= 399,
"300";
IF ( [Code — kopia.2] >= 400 && [Code — kopia.2] <= 499,
"400"; "NotExist" )
)
)
)

BUT IT DOESN't WORK. 

 

Can you help me? I need a piece of advice 😞

  • VasTg's avatar
    VasTg
    6 years ago

    ola1996 

     

    Refer to the link in my previous post as it solves the exact problem. Basically you have to create a custom column and give your conditions in query editor.

     

    If it helps, mark it as a solution. 

    Kudos are nice too.

6 Replies