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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
fbarini
Frequent Visitor

Help with Conditional Column (Date Issue)

Hello, I'm having trouble to find a condition formula to my column.

 

I'm trying to track Helpdesk Backlogs, but I just can't find a solution to format the new column. From my POV, it's a simple problem, but as a somewhat beginner I'm suffering a bit to make things work properly

 

I have a column named "Creation Date" which should be enough to classify all the rows. Here are the following rules:

 

1. If Service Request was created between May/01/2021 and May/31/2021, it should be "Inside Month"

2. If service Request was created between Apr/01/2021 and Apr/30/2021, it should return "30 days"

3. If service Request was created on or before Mar/31/2021, it should return "60 days"

 

It might seems obvious, but this formula needs to be inteligent, since I want to autoupdate it everyday as months pass by.

 

I tried to start with the following formula just to test the first rule, but it didn't count correctly and it also counts May/2020. I also have no idea on how to write the 2. and 3. rules.

 

fbarini_0-1620406455785.png

 

Any help is aprecciated, thanks in advance.

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@fbarini 

Try something using DATEDIFF like this.

Backlog 2 = 
VAR _Today = TODAY()
VAR _Months = DATEDIFF(BaseChamados[Data de Criacao],_Today,MONTH)
RETURN 
SWITCH(
    _Months,
    0,"Inside Month",
    1,"30 days",
    2,"60 days",
    3,"90 days",
    "91+ days"
)

jdbuchanan71_0-1620408665602.png

 

View solution in original post

1 REPLY 1
jdbuchanan71
Super User
Super User

@fbarini 

Try something using DATEDIFF like this.

Backlog 2 = 
VAR _Today = TODAY()
VAR _Months = DATEDIFF(BaseChamados[Data de Criacao],_Today,MONTH)
RETURN 
SWITCH(
    _Months,
    0,"Inside Month",
    1,"30 days",
    2,"60 days",
    3,"90 days",
    "91+ days"
)

jdbuchanan71_0-1620408665602.png

 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.