Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Ok, let me try to explain my problem.
Thats mt Matrix Table setup,
Rows I set a Group and a Subgroup,
Columns i set a Calculation Group with 8 columns
(Prev Week, Curr. Week, Target, Pre. Month, Curr. Month, Prev. Year, Curr. Year, Delta Target) all calculations with SELECTEDMEASURE() are working fine.
Values 5 Measures. The values are switched to rows an this is what it looks like
So far so good, when I drill the calculations are good.
Now I use 2 Measures to format Background and Font Color
For the Background Measure
KPI Week Formating Background =
VAR _measureNamePeriod = SELECTEDVALUE('KPI Week'[Name])
RETURN
SWITCH(TRUE,
_measureNamePeriod = "Sett. Corrente", "#E8D166",
_measureNamePeriod = "Target", "#E6E6E6"
)
That gets the selected KPI Week[Name] and depending on its text set a background color, the "Sett. Corrente" columns works fine, but the "Target" doesnt change.
For the Font Color the same problem for the "Delta Target" column
I should evidence the difference from the target
KPIs Formating Font Color Saturazione =
VAR _week = MAX(dimCalendar[CurrentWeekOffset])
VAR _year = MAX(dimCalendar[CurrentYearOffset])
VAR _measureNamePeriod = SELECTEDVALUE('KPI Week'[Name])
VAR _targetSaturazione = [Trg](dimTarget[MopCategoriaTarget_Description] = "Saturazione")
VAR _saturazioneWeek = [Saturazione](REMOVEFILTERS(dimCalendar), dimCalendar[CurrentWeekOffset] = _week)
VAR _saturazioneYear = [Saturazione](REMOVEFILTERS(dimCalendar), dimCalendar[CurrentYearOffset] = _year && dimCalendar[CurrentWeekOffset] <= _week)
VAR _currentWeekColName = {"Sett. Corrente", "Mese Corrente", "Anno Corrente"}
VAR _deltaYearColName = { "Delta Target" }
RETURN
SWITCH(TRUE,
_measureNamePeriod IN _currentWeekColName && _targetSaturazione > 0 &&
_saturazioneWeek > _targetSaturazione, "#118D11",
_measureNamePeriod IN _currentWeekColName && _targetSaturazione > 0 &&
_saturazioneWeek < _targetSaturazione, "#E66C37",
_measureNamePeriod IN _deltaYearColName && _targetSaturazione > 0 &&
_saturazioneYear > _targetSaturazione, "#118D11",
_measureNamePeriod IN _deltaYearColName && _targetSaturazione > 0 &&
_saturazioneYear < _targetSaturazione, "#E66C37"
)
At the previous image you can see "Set. Corrente", "Mese Corrente" and "Anno Corrente" correctly colored but "Delta Target" doesn't change.
Can you help me?
Thank you.
are you able to share your model? if not you need to test to see what it is returning to make sure its doing what you expect. also validate the hex codes are correct and giving you thee colour you want.
Proud to be a Super User!
ty for your reply, just in case, even if I set the backgound measure hardcoded a color withouth checking column names, all the columns but target and delta target are colored, the same fore Font Color
User | Count |
---|---|
73 | |
70 | |
38 | |
24 | |
23 |
User | Count |
---|---|
96 | |
93 | |
50 | |
41 | |
40 |