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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Blitz_40
New Member

Nested if with five condition

Hi! I am new to PBI and DAX. I've done a few simple If statements, but have not been able to figure this one out. I know this is probably elementary, but I have spent the about three hours trying to do a DAX formula that says this:

 

=IF(Table[Sum of Days]>1 and <=3,”Daily”

=IF(Table[Sum of Days]>3  and  <=18,”Weekly”

=IF(Table[Sum of Days]>18 and <=28,”Monthly”

=IF(Table[Sum of Days]>29,”Other”

Otherwise Blank

 

I've used a dozen examples of similar conditions that I found in other solutions that you guys have provided, but I obviously don't know what I'm doing because I can't seem to modify this to any of the examples.

Can I do five conditions? Is that what is wrong? Should I be using AND instead of OR?

Thank you for any assistance!

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@Blitz_40 - Use a SWITCH(TRUE()...) statement, not nested IF statements. Logic is cleaner, will make things very easy.

Column =
SWITCH(TRUE(),
  [Sum of Days]>1 && [Sum of Days]<=3,”Daily”,
  [Sum of Days]>3 && [Sum of Days]<=18,”Weekly”,
  [Sum of Days]>18 && [Sum of Days]<=28,”Monthly”,
  [Sum of Days]>29,”Other”,
  BLANK()
)


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@Blitz_40 - Use a SWITCH(TRUE()...) statement, not nested IF statements. Logic is cleaner, will make things very easy.

Column =
SWITCH(TRUE(),
  [Sum of Days]>1 && [Sum of Days]<=3,”Daily”,
  [Sum of Days]>3 && [Sum of Days]<=18,”Weekly”,
  [Sum of Days]>18 && [Sum of Days]<=28,”Monthly”,
  [Sum of Days]>29,”Other”,
  BLANK()
)


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler Thank you! I will be frank and say that I am not familiar with SWITCH. 

I need to explore the difference so I can understand the application. I appreciate it! 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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