0

Dynamic Caption for prior month

  Trying to use a dynamic caption to show the field name as "Net Written Premium to Feb-2023"

 

I'm trying to get the Feb 2023 part using : Lag(StrToMember(
[RiskExtract].[Inception full month name],DateFormat(
dateTime(), "MMM yyyy"
)
),1) but is coming up with a number. Is anyone able to help please :)

2 replies

null
    • Senior Director of Product
    • Ian_Macdonald
    • 1 yr ago
    • Reported - view

    Hi Nicholas,

    You are very close!

    Your code as it stands will return the Member value for Feb 2023, not it's display caption.

    You need to add ".caption" at the end, like this:

        Lag(StrToMember([RiskExtract].[Inception full month name],DateFormat(dateTime(), "MMM yyyy")),1).caption

    and concatenate it to the rest of the caption string. Here's an example  on our demo data:

    Save the calculation as "Last Month" Results in:

    So my Calculated Member, Last Month, is showing with my dynamic caption. I've added The actual Feb 23 member as well for comparison.

    Hope that helps!

    Ian

    • Nicholas_Campbell
    • 1 yr ago
    • Reported - view

    Thanks as always Ian :)

Content aside

  • Status Answered
  • 1 yr agoLast active
  • 2Replies
  • 53Views
  • 2 Following