Forum Discussion

PBE's avatar
PBE
Helper II
3 years ago
Solved

Dynamic Matrix Column Month Header

Hi

I would like matrix column names to change in relation to current month.

If current Month is November I would like column headings to be

Account          November October September

ABC001                 100          120         90    

If current month is December headings to be

Account          December November October

ABC001                 100          120         90    

To show figures for current and previous two months. I can produce the figures I don't know how to make column headers dynamic.

Rather than have to retype them when the date changes to a new month.

The account and figures are just for information and do not affect the column heading.

 

Is it possible to change matrix column heading using a formula or some other way?

 

Thank you in advance

 

Pete

  • In a Matrix, put Month Name in Columns, then add a date slicer and limit to the last 3 months. 

     

  • PBE Thanks for the Kudos! Can you please accept as solution if this has solved the issue?

  • Hi PBE ,

     

    Please enable field parameters in preview features:

     

     

    This is my test table:

     

    Create tewo measures:

    Nov = CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Month] = "Sep" || 'Table'[Month] = "Oct" || 'Table'[Month] = "Nov"))
    
    Dec = CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Month] = "Dec" || 'Table'[Month] = "Oct" || 'Table'[Month] = "Nov"))

     

    Select "Fields" in Modeling tab:

    Add two measure just created.

    You will get a parameter table like this:

     

    Create a slicer using parameter just created and create a matrix as below shown:

     

    Then you can Dynamic Matrix Column Month Header:

    Best regards,

    Yadong Fang

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