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
Anonymous
Not applicable

Dynamic name of measure for MTD calculations,Pre Month MTD name,Last to last month name

Hello Guys,

 

I have calculated MTD,Last month MTD, Last to last month MTD etc but problems are here is how to assing the dynamic name of the calculations like,

for example

this is current month Aug21 so MTD should be MTD Aug'21 and if we are in next month then it should automatically MTD Sep'21 on headers.

 

Similarly I have to show the name of Last month calculations, last to last months etc.

Any suggestions please help me.

@Tanushree_Kapse 

Thanks.

 

1 ACCEPTED SOLUTION
Tanushree_Kapse
Impactful Individual
Impactful Individual

Hi @Anonymous ,

Please find the below measures to display the month names:

Current date = FORMAT(CALCULATE(max('Table (3)'[Date]),DATESMTD('Table (3)'[Date])),"MMM-YY")
 
Last Month = FORMAT(CALCULATE(max('Table (3)'[Date]),DATESMTD(dateadd('Table (3)'[Date],-1,MONTH))),"MMM-YY")
 
Last to Last Month = FORMAT(CALCULATE(max('Table (3)'[Date]),DATESMTD(dateadd('Table (3)'[Date],-2,MONTH))),"MMM-YY")
 
I hope this helps!
 
Mark this as a solution if I answered your question. Kudos are always appreciated.
Thanks!!

View solution in original post

1 REPLY 1
Tanushree_Kapse
Impactful Individual
Impactful Individual

Hi @Anonymous ,

Please find the below measures to display the month names:

Current date = FORMAT(CALCULATE(max('Table (3)'[Date]),DATESMTD('Table (3)'[Date])),"MMM-YY")
 
Last Month = FORMAT(CALCULATE(max('Table (3)'[Date]),DATESMTD(dateadd('Table (3)'[Date],-1,MONTH))),"MMM-YY")
 
Last to Last Month = FORMAT(CALCULATE(max('Table (3)'[Date]),DATESMTD(dateadd('Table (3)'[Date],-2,MONTH))),"MMM-YY")
 
I hope this helps!
 
Mark this as a solution if I answered your question. Kudos are always appreciated.
Thanks!!

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