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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
newbie9
Helper I
Helper I

year to last date of the year

Hi,

my problem is 

I have year in slicers which is a text & month as slicer which is also text

so if I select year I need to get the last date of the year i.e. if I click 2022 then I need to get 31/12/2022

if I click 2022 in year & june in month I need to get 30/6/2022 

 

is there a way to do it?

1 ACCEPTED SOLUTION
v-xinruzhu-msft
Community Support
Community Support

Hi @newbie9 

You can use EOMONTH() function.

e.g 

Measure = EOMONTH(MAX('Table'[Column1]),0)

vxinruzhumsft_0-1694414110337.png

 

You can refer to the following link to know more about the function.

EOMONTH function (DAX) - DAX | Microsoft Learn

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xinruzhu-msft
Community Support
Community Support

Hi @newbie9 

You can use EOMONTH() function.

e.g 

Measure = EOMONTH(MAX('Table'[Column1]),0)

vxinruzhumsft_0-1694414110337.png

 

You can refer to the following link to know more about the function.

EOMONTH function (DAX) - DAX | Microsoft Learn

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ritaf1983
Super User
Super User

Hi @newbie9 
Yes, you can add, end _of_ end-of-month column to your table, for example from PQ, like in the picture:

Ritaf1983_0-1694242535474.png


And use it according to selection with the  measure like :

selected end of month = max('Date'[End of Month])

Ritaf1983_1-1694242816134.png

Link to the sample file 

 

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly



Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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