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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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