Forum Discussion

ak77's avatar
ak77
Post Patron
3 years ago
Solved

Dynamic column header for year display

Hi all

 

i have a requirement to display column headers of TABLE vizualization. The user selects the year and DAx calculates sum for previous 3 years and  display them in the TABLE vizualization columns as below. 

Now the user wants these 3 columns to be dynamic. Ex:User selects 2022, the column header should dynamically change to previos 3 years 2021,2020 and 2019.

 

Is this possible in power bi? please help

  • Hi ak77 ,

    By defalt, it's not supported in Power BI, you can vote the idea to improve this feature.

    Here's a workaroud to do it:

    1.Create a measure:

    Header =
    "       "
        & SELECTEDVALUE ( 'Table'[Year] ) - 3 & "        "
        & SELECTEDVALUE ( 'Table'[Year] ) - 2 & "       "
        & SELECTEDVALUE ( 'Table'[Year] ) - 1
    

    2.Put it in a card visual and turn off the category label, then overlap the column header.

    Get the result:

    I attach my sample below for your reference.

     

    Best regards,

    Community Support Team_yanjiang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

1 Reply

  • Hi ak77 ,

    By defalt, it's not supported in Power BI, you can vote the idea to improve this feature.

    Here's a workaroud to do it:

    1.Create a measure:

    Header =
    "       "
        & SELECTEDVALUE ( 'Table'[Year] ) - 3 & "        "
        & SELECTEDVALUE ( 'Table'[Year] ) - 2 & "       "
        & SELECTEDVALUE ( 'Table'[Year] ) - 1
    

    2.Put it in a card visual and turn off the category label, then overlap the column header.

    Get the result:

    I attach my sample below for your reference.

     

    Best regards,

    Community Support Team_yanjiang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.