Forum Discussion
Data Color Is not Visible | conditional format fx not visible for custom colors
- 1 year ago
Create a mesure for color logic:
Order Date Color =
VAR _MaxDate = MAX('YourTable'[ORDER_DATE])
VAR _MinDate = MIN('YourTable'[ORDER_DATE])RETURN
SWITCH(
SELECTEDVALUE('YourTable'[ORDER_DATE]),
_MaxDate, "#FF5733", -- š¶ Orange for the latest date
_MinDate, "#3498DB", -- š· Blue for the older date
"#808080" -- Default Gray (just in case)
)Then apply condiotional formatting based on this measure.
- Anonymous1 year ago
Hi Raghu3636ļ¼
Actually, there is no direct way to apply conditional format for a dynamic date on the Legend in Power BI, which is by design.
If you want this feature to be supported, you could raise an idea here:
https://ideas.fabric.microsoft.com/
As a workaround, you could consider to configure your bar chart as below, then create a measure to apply this condition format:
Date Color = VAR MaxDate = CALCULATE(MAX('Table'[ORDER_DATE]), ALL('Table')) VAR MinDate = CALCULATE(MIN('Table'[ORDER_DATE]), ALL('Table')) VAR CurrentDate = VALUES('Table'[ORDER_DATE]) RETURN SWITCH( TRUE(), CurrentDate = MaxDate, "Max", CurrentDate = MinDate, "Min", "Other" )Here is the .pbix file for your reference:
Create a mesure for color logic:
Order Date Color =
VAR _MaxDate = MAX('YourTable'[ORDER_DATE])
VAR _MinDate = MIN('YourTable'[ORDER_DATE])
RETURN
SWITCH(
SELECTEDVALUE('YourTable'[ORDER_DATE]),
_MaxDate, "#FF5733", -- š¶ Orange for the latest date
_MinDate, "#3498DB", -- š· Blue for the older date
"#808080" -- Default Gray (just in case)
)
Then apply condiotional formatting based on this measure.