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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

DAX Nested If Bucketing

Hello Team,

 

I could not work out the formula into Power BI is there a limitation in the nested ifs?

 

IF [Days] <30 THEN "<30 Days"
ELSEIF [Days] >= 30 AND [Days] <= 69 THEN "30-69 Days"
ELSEIF [Days] >= 70 AND [Days] <= 100 THEN "70-100 Days"
ELSEIF [Days] >= 101 AND [Days] <= 140 THEN "101-140 Days"
ELSEIF [Days] >= 141 AND [Days] <= 180 THEN "141-180 Days"
ELSE ">180 Days" END

 

How do i put this in DAX?

1 ACCEPTED SOLUTION

@Anonymous , true need to use true() ,

 

Also this code for the new columns not measure. So hope you ar creating a new column

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
TomMartens
Super User
Super User

Hey @Anonymous ,

 

there is no limitation in nesting, besides the fact that DAX doesn't know ELSEIF, for this reason you have to use the SWITCH function: SWITCH – DAX Guide

 

Hopefully, this provides ideas on how to tackle your challenge.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Anonymous
Not applicable

Laedays_0-1628748094037.png

 

can you help why it's being considered wrong?

@Anonymous , true need to use true() ,

 

Also this code for the new columns not measure. So hope you ar creating a new column

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

May 2025 Monthly Update

Fabric Community Update - May 2025

Find out what's new and trending in the Fabric community.