Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Mahamood0218
Helper II
Helper II

can not find age buckets

hi,

i am not able to find age Buckets by using if statement ,

Mahamood0218_0-1671081333790.png

could you please suggest from 61 to 90days and >90days.

 

Thanks.

2 ACCEPTED SOLUTIONS
Mahesh0016
Super User
Super User

age= IF('Date'[age]<=30,"<30days",IF('Date'[age]>=31 && 'Date'[age]<=60,"31 to 60 days",IF('Date'[age]>=61 && 'Date'[age]<=90,"61 to 90 days",IF('Date'[age]>90 ,">90days"))))
 

View solution in original post

Anonymous
Not applicable

try this:

 

Bucket =
SWITCH(
    TRUE(),
    Days[Days]<30,"<30days",
    Days[Days]<60,"30 to 60 days",
    Days[Days]<90,"60 to 90 days",
    ">90days"
)

View solution in original post

6 REPLIES 6
Mahamood0218
Helper II
Helper II

thank you all now dax fuction is working

Anonymous
Not applicable

try this:

 

Bucket =
SWITCH(
    TRUE(),
    Days[Days]<30,"<30days",
    Days[Days]<60,"30 to 60 days",
    Days[Days]<90,"60 to 90 days",
    ">90days"
)
AilleryO
Memorable Member
Memorable Member

Hi,

 

Or you could do the test the other way (starting with biggest numbers), to make it more simple :

age buckets = IF('Date'[age]>90,">90days",
IF('Date'[age]>60,"61 to 90 days",
IF('Date'[age]>30,"31 to 60 days",
IF('Date'[age]<30 ,"<30 days"))))

Hope it helps

@AilleryO it is not correct.

Hi,

 

Can you tell us more or provide sample data because it should work, maybe a problem with parenthesis or column name (should be [Days] not [Age] ?)...

age buckets = IF('Table'[Days]>90,">90days",
IF('Table'[Days]>60,"61 to 90 days",
IF('Table'[Days]>30,"31 to 60 days",
IF('Table'[Days]<30 ,"<30 days"))))

I'm in a train so cannot make proper test but it should work, if your column is type number.

Let us know

Mahesh0016
Super User
Super User

age= IF('Date'[age]<=30,"<30days",IF('Date'[age]>=31 && 'Date'[age]<=60,"31 to 60 days",IF('Date'[age]>=61 && 'Date'[age]<=90,"61 to 90 days",IF('Date'[age]>90 ,">90days"))))
 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Solution Authors