Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi,
From a date column, I would like to calulate a measure which which find the value associated to the last day of the current month.
Can you assist in this?
Thanks
Solved! Go to Solution.
Hi @Anonymous ,
The command in Dax for this is the "eomonth" command. As explained here:
EOMONTH function (DAX) - DAX | Microsoft Learn
But, if you are doing it in M, then it would be these 5 steps:
Proud to be a Datanaut!
Private message me for consulting or training needs.
You can also do this in Power Query if needed. I do this a lot with StartOfMonth to group records.
Define a custom column with Date.EndOfMonth([YourDateTimeColumn])
Hey!
Do you want a measure or a calculated column?
A measure needs a scalar value, so the EOMONTH() needs to be combined with either MIN() or MAX() to bring it down to a single value. Be aware of the context within the visual. If you have a category that contains multiple dates it will either select the first date MIN(), or the last date MAX().
The dax for a measure is:
Hi @Circuscazz ,
The command in Dax for this is the "eomonth" command. As explained here:
EOMONTH function (DAX) - DAX | Microsoft Learn
Proud to be a Datanaut!
Private message me for consulting or training needs.
You can also do this in Power Query if needed. I do this a lot with StartOfMonth to group records.
Define a custom column with Date.EndOfMonth([YourDateTimeColumn])
Hi @Anonymous ,
The command in Dax for this is the "eomonth" command. As explained here:
EOMONTH function (DAX) - DAX | Microsoft Learn
But, if you are doing it in M, then it would be these 5 steps:
Proud to be a Datanaut!
Private message me for consulting or training needs.
Sorry DAX measure is needed
Hey!
Do you want a measure or a calculated column?
A measure needs a scalar value, so the EOMONTH() needs to be combined with either MIN() or MAX() to bring it down to a single value. Be aware of the context within the visual. If you have a category that contains multiple dates it will either select the first date MIN(), or the last date MAX().
The dax for a measure is: