I have a calculated table within a report that consists of the latest 12 months revenue and a total of those 12 months. This automatically updates when the data is refreshed. The code used for the calculated table is shown below:
Previous12MonthsRevenue = {
("P12M TR", NAMEOF(NewMeasures[LYPrev12MonthRevenue]), 13),
([LatestMonth], NAMEOF(NewMeasures[LatestMonthRev]), 12),
([LatestMonth-1], NAMEOF(NewMeasures[LatestMonthRev-1]), 11),
([LatestMonth-2], NAMEOF(NewMeasures[LatestMonthRev-2]), 10),
([LatestMonth-3], NAMEOF(NewMeasures[LatestMonthRev-3]), 9),
([LatestMonth-4], NAMEOF(NewMeasures[LatestMonthRev-4]), 8),
([LatestMonth-5], NAMEOF(NewMeasures[LatestMonthRev-5]), 7),
([LatestMonth-6], NAMEOF(NewMeasures[LatestMonthRev-6]), 6),
([LatestMonth-7], NAMEOF(NewMeasures[LatestMonthRev-7]), 5),
([LatestMonth-8], NAMEOF(NewMeasures[LatestMonthRev-8]), 4),
([LatestMonth-9], NAMEOF(NewMeasures[LatestMonthRev-9]), 3),
([LatestMonth-10], NAMEOF(NewMeasures[LatestMonthRev-10]), 2),
([LatestMonth-11], NAMEOF(NewMeasures[LatestMonthRev-11]), 1)
};
The [LatestMonth] […-1] etc, are measures which returns the month and year in “mmm-yy” format to display as dynamic column headers
And the [LatestMonthRev] […-1], etc are measures which calculate the sum of the revenue for that filtered date.
Both these measure work individually
I added this into the columns field on a table visual within power BI. The image below shows how the table used to function, this occurred as soon as you dragged the first column of the calculated table into the table visual with 0 formatting:
When trying to recreate this table visual within a new report with the same data an issue occurs. The DAX function works and produces the same calculated table, however, when inserting the column into a table visual it shows like the screenshot below:
My question is: Does anyone know how to rectify this issue to enable the calculated table to function the way it used to?
UPDATE dummy data here so you guys can help!
https://shorturl.at/YDHuH
7