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
sy898661
Helper V
Helper V

how to find data up to the end of last month

Hi all!

 

I am trying to set up a way to see my data that is up to the end of last month (not specifically last month, but in general the month prior to the current month) if that makes sense...

 

My data is set up so that the WIP Completion month for each line shows as the 1st of each month (so even if it was completed 15-March it will show as 1-March)

 

and for example for today, I would want to show everything that happened before 1-April.... next month I will want to show everything that happened before 1-May, etc

 

I tried the following code but it is still including data points from this month, what should I do?

End of Month Data = IF(AND(NOT ISBLANK('Table'[WIP Completion Month]), 'Table'[WIP Completion Month] < TODAY()), "Y", BLANK())

 

Thank you so much!! 🙂

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

Would be easier if could see some example data. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Is your WIP Completion Month a date or a month number or month text? If it is a month number, then you would need MONTH(TODAY()) instead of TODAY() for example.

 

If it is a true date, I would do something like:

End of Month Data = 
  IF(
    AND(
      NOT(
        ISBLANK('Table'[WIP Completion Month])
      ),
      'Table'[WIP Completion Month] < DATE(YEAR(TODAY()),MONTH(TODAY()),1)
    ), 
    "Y", 
    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

3 REPLIES 3
Greg_Deckler
Community Champion
Community Champion

Would be easier if could see some example data. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Is your WIP Completion Month a date or a month number or month text? If it is a month number, then you would need MONTH(TODAY()) instead of TODAY() for example.

 

If it is a true date, I would do something like:

End of Month Data = 
  IF(
    AND(
      NOT(
        ISBLANK('Table'[WIP Completion Month])
      ),
      'Table'[WIP Completion Month] < DATE(YEAR(TODAY()),MONTH(TODAY()),1)
    ), 
    "Y", 
    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 that worked perfectly thank you!!

MattAllington
Community Champion
Community Champion

There are various ways to do this.  I prefer a calcualted column

You should create a calendar table first. https://exceleratorbi.com.au/power-pivot-calendar-tables/

Then add a calculated column in the calendar table. There are many ways to write this too, but basically you need to check if today's date is in a completed month or not.  Something like this should work.

 

Column =
VAR Today = TODAY ()
VAR Year = YEAR ( today )
VAR Month = MONTH ( today )
RETURN
    IF (
        'Calendar'[Date] >= DATE ( Year, Month, 1 ),
        "Incomplete",
        "Fully Complete"
    )

 



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

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.