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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

IF statement: Need to add previous month and previous previous month conditions..

Hi all,

I have an IF statement that I would like to add a previous month and previous previous month condition: 

 

ErrorTier = (IF('fsa'[TotalError%]<3 && sum('fsa'[FundedCount])>=100,"Tier2",
                   IF('fsa'[TotalError%]<3 && sum('fsa'[FundedCount])>=100,"Tier3",
                   "Tier1")))
  • The condition is the same, the only difference is how long they keep it for
  • if someone maintains the two conditions for the previous month they would be labeled Tier2,
  • if they maintain it for two consecutive months they would be Tier3

The date variable is called date1

Thanks!

 
 
1 REPLY 1
speedramps
Super User
Super User

Create a ca;nea table with offsets

See how here ...

https://www.youtube.com/watch?v=zXZAZrUwUe8

https://www.youtube.com/watch?v=5RB3Jdfrn1s

 

The create dax measures to get the ErrorTier for each month

ErrorTier0M = CALCULATE( [ErrorTier], 'Calendar'[monthoffset] =0)

ErrorTier1M = CALCULATE( [ErrorTier], 'Calendar'[monthoffset] =-1)
ErrorTier2M  = CALCULATE( [ErrorTier], 'Calendar'[monthoffset] =-2)

Your answer =
SWITCH(  True(),
ErrorTier 0M= ErrorTier1M     &&     ErrorTier 0M = ErrorTier 2M     , "Tier3",
ErrorTier 0M = ErrorTier1M    ,  "Tier2",
ErrorTier 0M)

 

Thanks for reaching out for help.

I put in a lot of effort to help you, now please quickly help me by giving kudos.

Remeber we are unpaid volunteers and here to coach you with Power BI and DAX skills and techniques, not do the users job for them. So please click the thumbs up and accept as solution button. 

If you give someone a fish then you only give them one meal, but if you teach them how to fish then they can feed themselves and teach others for a lifetime.  I prefer to teach members on this forum techniques rather give full solutions and do their job. You can then adapt the technique for your solution, learn some DAX skills for next time and soon become a Power BI Super User like me. 

One question per ticket please. If you need to extend your request then please raise a new ticket.

You will get a quicker response and each volunteer solver will get the kudos they deserve. Thank you ! 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors