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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Igotzepowerbi
Frequent Visitor

Need A dynamic Year Title Dax Calc

Hello,

I have three year measures and my client wants the titles to be dynamic. So instead of saying Last Year Sum it would say 2023 - 2 years ago would say 2022. I don't want to have to change the titles every year. Does anyone know of a way to accomplish this?
Example of current dax calc.

2 years ago =
IF (
    SELECTEDVALUE ( 'Dollars / Units'[selected Dollars/Units Name] ) = "Dollars",
    CALCULATE (
        [sum of dollars],
        FILTER (
            'POS Aggregate',
            YEAR ( 'POS Aggregate'[Week End Date] )
                = YEAR ( TODAY () ) - 2
        )
    ),
    IF (
        SELECTEDVALUE ( 'Dollars / Units'[selected Dollars/Units Name] ) = "Units",
        CALCULATE (
            [sum of units],
            FILTER (
                'POS Aggregate',
                YEAR ( 'POS Aggregate'[Week End Date] )
                    = YEAR ( TODAY () ) - 2
            )
        )
    )
)

Igotzepowerbi_0-1713896908990.png

 

2 REPLIES 2
v-zhouwen-msft
Community Support
Community Support

Hi @Greg_Deckler ,thanks for the quick reply.

Hi @Igotzepowerbi ,

Regarding your question, is your requirement to dynamically modify the name of the measure based on the year selected by the slicer? I don't think this can be done, we can only dynamically select the output value.

Greg_Deckler
Super User
Super User

@Igotzepowerbi The Most Amazing, Mind Blowing Dynamic Slicer Titl... - Microsoft Fabric Community


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors