Forum Discussion
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_DecklerCommunity 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.
- StaceyGriffethHelper II
Greg_Deckler Basically I want the column title in the table visual to be the results of a measure. That way the title will update as the value of the measure changes.
- Greg_DecklerCommunity Champion
StaceyGriffeth In general, to use a measure in that way, you need to use the Disconnected Table Trick as this article demonstrates: https://community.powerbi.com/t5/Community-Blog/Solving-Attendance-with-the-Disconnected-Table-Trick/ba-p/279563
If you can share data, can be more specific.
- vanessafvgCommunity Championdo you leave it on its auto settings? Does this help at all https://www.youtube.com/watch?v=TYLKDPcvgK8
- StaceyGriffethHelper 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.
- amitchandakSuper User
StaceyGriffeth , Not very clear. There is something to know dynamic column name.
refer: https://goodly.co.in/dynamic-column-names-power-query/
Or Dynamic Title : https://community.powerbi.com/t5/Desktop/Dynamic-title/td-p/378426
See if these can help
- AnonymousNot 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
- AnonymousNot 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