Forum Discussion
Haroldhngn
4 months agoAdvocate I
Enable Dynamic Column Headers in Matrix Visual (Context-Aware Labels)
Hello Power BI Team, I would like to suggest a new feature for the Matrix visual in Power BI: the ability to use dynamic column headers that reflect the current context, such as displaying actual mo...
Haroldhngn
4 months agoAdvocate I
Use fixed by "selected and switch" function to replace hardcode Prev. and Curr. by selected value of previous month and current month.
Haroldhngn
4 months agoAdvocate I
DynamicShortNameLatestMth =
VAR CurrIndex = CALCULATE(MAX(Dates[DateIndex]), ALL(Dates))
VAR CurrMonth =
CALCULATE(
MAX(Dates[Mth]),
FILTER(ALL(Dates), Dates[DateIndex] = CurrIndex)
)
VAR PrevMonth =
CALCULATE(
MAX(Dates[Mth]),
FILTER(ALL(Dates), Dates[DateIndex] = CurrIndex - 1)
)
RETURN
SWITCH(
TRUE(),
StaticMeasureMapping[ShortName] = "Curr.", CurrMonth,
StaticMeasureMapping[ShortName] = "Prev.", PrevMonth,
StaticMeasureMapping[ShortName]
)