Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi everyone,
my model looks like:
I’m using the following measures to color visuals dynamically based on ranking:
Rank (Current Axis) =
VAR Result =
IF (
ISINSCOPE ( fct_amortizedcosts[MeterSubCategory] ),
RANKX (
ALLSELECTED ( fct_amortizedcosts[MeterSubCategory] ),
CALCULATE ( [Total Amortized Cost] ),
,
DESC,
DENSE
),
IF (
ISINSCOPE ( fct_amortizedcosts[MeterCategory] ),
RANKX (
ALLSELECTED ( fct_amortizedcosts[MeterCategory] ),
CALCULATE ( [Total Amortized Cost] ),
,
DESC,
DENSE
),
BLANK ()
)
)
RETURN Result
Color by Rank =
VAR r = [Rank (Current Axis)]
RETURN
SWITCH (
TRUE(),
ISBLANK ( r ) || r > 5, "#B3B3B3",
r = 1, "#E81123",
r = 2, "#107C10",
r = 3, "#0078D4",
r = 4, "#FFB900",
r = 5, "#8E8CD8"
)This works perfectly in donut and bar charts, but when I try to apply the same color logic to a Line and clustered column chart (with Date on the X-axis), all columns turn gray:
Has anyone managed to make field value–based coloring work on a time-series chart when the rank is calculated by category (MeterCategory) and not by the date axis?
Example mode, use Problem to solve page:
https://drive.google.com/file/d/14lpEWK-MQ6JMU5_15WVh8Gv22AiGvdpR/view?usp=drive_link
I think that MeterCategory column does not exist in specific visual and this is why visual does not read it as ISINSCOPE function.
I tried with HasONeValue but the same i think it is in visual level, not page level filter context...how to pass this ?
Thanks for any suggestions!
Create a separate measure that preserves the category context:
Time Series Color =
VAR CurrentCategory = SELECTEDVALUE(fct_amortizedcosts[MeterCategory])
RETURN
IF(
NOT ISBLANK(CurrentCategory),
[Color by Rank],
"#B3B3B3"
)
Use this measure for conditional formatting in your time-series chart. It maintains the category context that gets lost in the date grouping.
Thank you. It is closer to finishing it, but it still is not working.
In chart I put:
but still within Color by Rank I am refering to
VAR r = [Rank (Current Axis)]
which is using IsInScope:
Best,
Jacek
Nope, this can be achieved by adding MeterCategory to the Legend. It is native Power BI behavior which sucks badly because I can not set up column colors through conditional formatting.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 9 | |
| 5 | |
| 4 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 23 | |
| 12 | |
| 11 | |
| 9 | |
| 8 |