cancel
Showing results for
Did you mean:
Highlighted
Frequent Visitor

## DAX first day of current month

I want to do Month to date and year to date calculation without using MTD and YTD functions. I know Today() stands for Today's date. In the same lines can someone please tell me how do I get the first day of current month (example 1/1/2017 currently) and first day of current year? TIA.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Champion

## Re: DAX first day of current month

@PowerBIlearner

FirstDayofCurrentYear = DATE(YEAR(TODAY()),1,1)

Lima - Peru
7 REPLIES 7
Super User I

## Re: DAX first day of current month

First Day of This Month = DATE(YEAR(TODAY()), MONTH(TODAY()), 1)

Did I answer your question? Please mark it as a solution.

Proud to be a Datanaut!
Community Champion

## Re: DAX first day of current month

@PowerBIlearner

FirstDayofCurrentYear = DATE(YEAR(TODAY()),1,1)

Lima - Peru
Resident Rockstar

## Re: DAX first day of current month

Cool my dear friend ,

try this one.

FIRSTDATE(Dates)

It will give u the first date from the date.

If u choose month it will give u the start of month, if u select year it will give start of year.

let me know if any help.

Super User III

## Re: DAX first day of current month

This is a way to easily calculate MTD and YTD without the need to calculate the first days first:

```[SalesYTD] :=
CALCULATE (
[Sales],
FILTER (
ALL ( 'Date' ),
'Date'[Year] = MAX ( 'Date'[Year] )
&& 'Date'[Date] <= MAX ( 'Date'[Date] )
)
)```

Taken from DAXPatterns here: http://www.daxpatterns.com/time-patterns/

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark my post as a solution. Thanks!

Imke Feldmann

How to integrate M-code into your solutionCheck out more PBI- learning resources here -- Performance Tipps for M-queries

New Member

## Re: DAX first day of current month

I did it but It doesn't work

Frequent Visitor

## Re: DAX first day of current month

Thanks, this has given me help on another problem I was having.

Frequent Visitor

## Re: DAX first day of current month

How can I get the first day of month If I have "Year" as a parameter?

If year 2018 - I need May 1,2018

if Year 2017 - I need May 1, 2017 etc

Announcements

#### New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

#### ‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

#### Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

#### Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

#### Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors