Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Create a custom measure for a title using min and max dates

Hi there

 

I have a dynamic title which shows the time period a user is looking at based on the period they've selected from my date slicer. 

The measure looks like this:

Title Sub Report = "CURRENTLY VIEWING MONTHS " & MIN('DimReportingPeriod'[Reporting Period]) & " TO " & MAX('DimReportingPeriod'[Reporting Period])
 
My problem, is the title shows the months as dd/mm/yyyy and it looks rubbish.
Within the DimReportingPeriod table, alongside the 'Reporting Period' date column is a text column called 'Reporting Name' which shows the associated 'mmmm yyyy' of the date. 
 
So, I want my title to show the 'Reporting Name' for the MIN of 'Reporting Period', and the 'Reporting Name' for the MAX of 'Reporting Period'.
 
I tried doing this using a CALCULATE and SELECTEDVALUE but it's not working.
 
Help!!!
 
Jemma 
  • Anonymous 

    You can put it this way as well:

    Title Sub Report = "CURRENTLY VIEWING MONTHS " & FORMAT(MIN('DimReportingPeriod'[Reporting Period]),"mmmm yyyy") & " TO " & FORMAT(MAX('DimReportingPeriod'[Reporting Period]),"mmmm yyyy")

    ________________________

    Did I answer your question? Mark this post as a solution, this will help others!.

    Click on the Thumbs-Up icon if you like this reply 🙂

    YouTube, LinkedIn 

3 Replies

  • Anonymous 

    You can put it this way as well:

    Title Sub Report = "CURRENTLY VIEWING MONTHS " & FORMAT(MIN('DimReportingPeriod'[Reporting Period]),"mmmm yyyy") & " TO " & FORMAT(MAX('DimReportingPeriod'[Reporting Period]),"mmmm yyyy")

    ________________________

    Did I answer your question? Mark this post as a solution, this will help others!.

    Click on the Thumbs-Up icon if you like this reply 🙂

    YouTube, LinkedIn 

    • Anonymous's avatar
      Anonymous
      Not applicable

      Faaabulous I didn't realise you could use FORMAT in this way, I will for sure be using it again! Thanks so much Fowmy 

  • Anonymous , have you tried this -Title Sub Report = "CURRENTLY VIEWING MONTHS " & format(MIN('DimReportingPeriod'[Reporting Period]),"mmmm yyyy") & " TO " & format(MAX('DimReportingPeriod'[Reporting Period]),"mmmm yyyy")