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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Create a Table with First and Last Date of Current Month

Hi Everyone,

 

I am trying to figure out how to create a table that has the first and last date of current month.

 

DAX expressions that I have tried:

 

Current_WholeMonth = 

Var Mindate = MIN( TODAY() )

Var Maxdate = MAX( TODAY() )

Return

CALENDAR (Mindate, Maxdate)

 

But, it states an error that mentions MIN only accepts a column reference.

 

I was wondering if anyone has a workaround for this. If MIN only accepts a column reference, how should I change the DAX expressions so that it only returns the first and last date of the current month?

 

Expected output (As of 2nd September 2022):

 

yacheou_0-1662089121070.png

 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Anonymous 

please use

 

Current_WholeMonth =
VAR Maxdate =
    EOMONTH ( TODAY (), 0 )
VAR Mindate =
    EOMONTH ( TODAY (), -1 ) + 1
RETURN
    CALENDAR ( Mindate, Maxdate )

 

View solution in original post

4 REPLIES 4
tamerj1
Super User
Super User

Hi @Anonymous 

please use

 

Current_WholeMonth =
VAR Maxdate =
    EOMONTH ( TODAY (), 0 )
VAR Mindate =
    EOMONTH ( TODAY (), -1 ) + 1
RETURN
    CALENDAR ( Mindate, Maxdate )

 

Anonymous
Not applicable

Thank you very much! It works like a charm.

Jihwan_Kim
Super User
Super User

Hi,

Please try something like below.

It is for creating a new table.

 

Current_WholeMonth Table =
VAR _mindate =
    EOMONTH ( TODAY (), -1 ) + 1
VAR _maxdate =
    EOMONTH ( TODAY (), 0 )
RETURN
    CALENDAR ( _mindate, _maxdate )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

Thank you very much! Finally, get the table I wanted.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.