Forum Discussion
Dynamic table column name
Greg_Deckler Here is the table:
The farthest right column, Cur, is the current month being reported (in this case June). -1 means current month less 1 (May), and so on. I have the following measures which set the current reporting month (updated monthly) and year (updated annually):
StaceyGriffeth Right, so as Disconnected Table Trick explains you create a disconnected table with the values you want in the columns. You use the measure to get the column value MAX('DisconnectedTable'[Column]). You can then use this in your measure to return the correct calculation. It's kind of warped thinking at first but it works. It is sort of the reverse of what you are doing now using a measure to compute the column value you want. Think that you already know which column you are in.
These things are difficult to mock up specifically without sample source data as text to copy and paste.
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
- StaceyGriffeth5 years agoHelper II
Greg_Deckler I've been going over the disconnected table trick trying to figure out how it can solve my problem. I see how it would isolate just the data I want to include in my table, but how does it solve the issue I have regarding the column name in the table visualization? It seems like I would still have to update the column name each month to reflect the month/year it represents?