cancel
Showing results for
Did you mean:
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

@PowerBIlearner

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

Lima - Peru
7 REPLIES 7
Super User I

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

Proud to be a Super User!

Community Champion

@PowerBIlearner

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

Lima - Peru
Resident Rockstar

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

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/

Imke Feldmann (The BIccountant)

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

New Member

I did it but It doesn't work

Frequent Visitor

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

Frequent Visitor

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

#### Power Platform Community Conference

Check out the on demand sessions that are available now!

#### Power Platform October Community Highlights

Check out the top community contributors across all of the communities

#### Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors