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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply

Get the Last Date from each "monthyear" which is a Textformat

Hi Community!

 

I pretty new to DAX so i hope someone can help me with this one.VS.PNG

 

This is my "Date Table" in my datacube. I am using the "Month-Year" as a SELECTEDVALUE in powerbi. and i need to compare the last date of each month-year to something. The Problem is that the Column "Month-Year" is of type TEXT so i can't use the ENDOFMONTH(date) function. Above the table you see the DAX query I used to create this Table. I hope there is a way with a DAX query to get somehow the Last date of each "Month-Year". 

 

 

3 REPLIES 3
v-xicai
Community Support
Community Support

Hi  @darko_ivanovic ,

 

Does that make sense? If so, kindly mark the right reply as a solution to help others having the similar issue and close the case. If not,  let me know and I'll try to help you further.

 

Best regards

Amy

Ashish_Mathur
Super User
Super User

Hi,

I suggest you create another calculated column formula to extract the Month =FORMAT('Date Table'[Date],"mmmm").  Then create 2 slicers - one each for Year and Month and select any one month and Year.  Then write this measure

=MAX('Date Table'[Date])

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-xicai
Community Support
Community Support

Hi @darko_ivanovic ,

 

The ENDOFMONTH function returns the last date of the month in the current context for the specified column of dates.

 

You may use the "Date" column instead of "Month-Year" column, then codes look like “ENDOFMONTH([Date]) ” .

 

If I misunderstood it, could you please share your sample data and desired output screenshots for further analysis? Do mask sensitive data before uploading.

 

Best Regards,

Amy

 

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

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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