Forum Discussion

StaceyGriffeth's avatar
6 years ago

Dynamic table column name

Is there a way to have the column name in a table visual dynamically update?  For example, I have a Trailing Twelve Month where it lists the current month and previous 11 month income statements.  The data automatically updates based on setting the current month in a measure.  However, I cannot get the month names to reflect in the column titles without manually changing them each month.  My workaround is to use a card for each column title with a measure which displays the appropriate month name.  The downside to this is that when the data refreshes as the current month is changed, the column widths change, and then the cards no longer line up.

 

11 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    StaceyGriffeth Hard to say exactly, can you share your PBIX or screen shots of what you are trying to achieve. Your measure formula, etc. 

     

     

    • StaceyGriffeth's avatar
      StaceyGriffeth
      Icon for Helper II rankHelper II

      vanessafvg I'm not clear on what you mean by auto settings?  The link is helpful for changing the title of the visual, but I'm looking for a way to change the name of the specific column in the table visual using the output of a measure.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi StaceyGriffeth ,

    According to my understand ,you want to dynamically display data in last X months based on Slicer,right? 

    You could use the following formula:

    DateSlicer =
    ALLSELECTED ( RevenueTable[Date] )
    flagForSelected =
    VAR _sele =
        SELECTEDVALUE ( DateSlicer[Date] )
    VAR _diff =
        DATEDIFF ( _sele, SELECTEDVALUE ( RevenueTable[Date] ), MONTH )
    RETURN
        IF ( _diff < 0 && _diff >= -6, 1 )
    toRemoveOtherColumns =
    SUM ( RevenueTable[Revenue] ) * [flagForSelected]
    sumForRow =
    SUMX ( RevenueTable, [toRemoveOtherColumns] )

    My visualization looks like this:

    Did I answer your question ? Please mark my reply as solution. Thank you very much.

    If not, please upload some insensitive data samples and expected output.

     

    Best Regards,

    Eyelyn Qin

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi StaceyGriffeth ,

    Sorry to disturb you...

    But did I answer your question ? Please mark my reply as solution. Thank you very much.
    If not, please upload some insensitive data samples and expected output.

     

    Best Regards,
    Eyelyn Qin