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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
ZachUnger
Helper II
Helper II

Date Formatting

Hi Team I'm working with the below data set and want to add a column with the bold results based on the scheduled date. 

Is there anyone that would know how to do this?? 

 

Consent No.InspectionStatusScheduled DateColour
CR2000000Scheduled1/01/2022Backlog
CR2000001In process27/12/2022Reporting Month
CR2000002Scheduled28/01/2022Next Month
CR2000003Scheduled14/02/2023Upcoming

 

Backlog = anything prior to reporting month

Reporting Month = anything with a date of the current month 

Next month = anything in the next month after reporting month 

Upcoming = anything after the next month 

 

Unsure if this can be done but keen on a solution if anyone has one. 

 

Cheer 

Z

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

 

Colour = 
VAR __CurrentMonthReporting =
    DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ), 1 )
VAR __NextMonthReporting =
    EOMONTH ( DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ), 1 ), 0 ) + 1
VAR __2MonthsReporting =
    EOMONTH ( DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ), 1 ), 1 ) + 1

RETURN
    IF (
        [Scheduled Date] < __CurrentMonthReporting,
        "Backlog",
        IF (
            AND (
                [Scheduled Date] >= __CurrentMonthReporting,
                [Scheduled Date] < __NextMonthReporting
            ),
            "Reporting Month",
            IF (
                AND (
                    [Scheduled Date] >= __NextMonthReporting,
                    [Scheduled Date] < __2MonthsReporting
                ),
                "Next Month",
                "Upcoming"
            )
        )
    )

 

 

transform99_1-1671503355925.png

 

 

Credit goes to previously answered questions (Found googling). I combined current/next/2month reporting views by declaring them as variables, and then used nested if statements.

 

Solved: How to express Next Month First Day, Prev. Month F... - Microsoft Power BI Community

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

 

Colour = 
VAR __CurrentMonthReporting =
    DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ), 1 )
VAR __NextMonthReporting =
    EOMONTH ( DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ), 1 ), 0 ) + 1
VAR __2MonthsReporting =
    EOMONTH ( DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ), 1 ), 1 ) + 1

RETURN
    IF (
        [Scheduled Date] < __CurrentMonthReporting,
        "Backlog",
        IF (
            AND (
                [Scheduled Date] >= __CurrentMonthReporting,
                [Scheduled Date] < __NextMonthReporting
            ),
            "Reporting Month",
            IF (
                AND (
                    [Scheduled Date] >= __NextMonthReporting,
                    [Scheduled Date] < __2MonthsReporting
                ),
                "Next Month",
                "Upcoming"
            )
        )
    )

 

 

transform99_1-1671503355925.png

 

 

Credit goes to previously answered questions (Found googling). I combined current/next/2month reporting views by declaring them as variables, and then used nested if statements.

 

Solved: How to express Next Month First Day, Prev. Month F... - Microsoft Power BI Community

vicky_
Super User
Super User

Try this:

New Column = SWITCH( TRUE(),
   MONTH([Scheduled Date]) = MONTH(TODAY()), "Reporting Month",
   MONTH([Scheduled Date]) < MONTH(TODAY()), "Backlog",
   MONTH([Scheduled Date]) = MONTH(TODAY()) + 1, "Next Month",
   "Upcoming"
)
   

You will probably need to tweak the above a little to get exactly what you need.

Helpful resources

Announcements
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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