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
matrix_user
Helper III
Helper III

Display latest month with text "Mid" for certain dates.

Hello,

 

I am currently using this DAX measure to display the latest month in a card visual. Is they anyone who could help modify this measure to display just before the month, the word "Mid -" when I import mid month data into my Power BI. Mid month data being the 15th of each month. I am not sure how it would work if for mid-month reporting my data goes only till the 12th etc for that particular month.

 

L/month = Calculate(Format(Max('Facttable' [Entry date]), "MMMM" & "YYYY"))

 

Any help would be appreciate.

 

4 REPLIES 4
matrix_user
Helper III
Helper III

I am not sure why I would need to abandon my curernt calendar and rebuild with a customer code calendar. This would mean re-aligninging my measures to the new calendar. 

 

I thought it could be a possibility to rewrite the DAX I am using to pickup up any loaded dates that registers as the 15th and displays 'Mid' (of whatever month is the latest in the date loaded. I am not particulary wanting to display data or counts etc relevant to mid months, just display the term "Mid" June/July/September etc whenever it have mid month data loaded.

Hi @matrix_user ,

 

Maybe you can try this code:

if mid month = 
IF (
    DAY ( MAX ( 'table'[date] ) ) > 15,
    FORMAT ( MAX ( 'table'[date] ), "Mid mmmm" ),
    BLANK ()
)

 

 

Best regards.

 

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

ChenwuZhu_Gmail,

 

I tried but I am now getting 1i30 - January 1900

 

If mid month = IF(MAX('Calendar'[Day]) >15,

FORMAT(MAX('Calendar'[Day]) "Mid MMMM" & 'YYYY"), BLANK())

 

Thanks for the suggestion anyway.

 

amitchandak
Super User
Super User

@matrix_user , refer to my custom calendar code

https://medium.com/chandakamit/cheat-sheet-calendar-that-starts-with-any-date-of-the-month-just-two-...

DAX Calendar - Standard Calendar, Non-Standard Calendar, 4-4-4 Calendar
https://www.youtube.com/watch?v=IsfCMzjKTQ0&t=145s

 

Then you need period rank and period day for time intelligence, which I have explained in

Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s

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.

Top Solution Authors