Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Raghu3636
Regular Visitor

Data Color Is not Visible | conditional format fx not visible for custom colors

Hi Team, 

 

I am tryig to build clustered bar chart. My data looks similar to the below. I dropped VENDOR in Y axis, Quantity under X Axis, and ORDER_DATE in legends, to get the quantity comparision for each vendor across dates. The data will refresh every day  and new dates will get loaded into the table(Every time the data refreshes it will only load 2 distinct dates, i.e.., It will not have more than 2 distinct dates in ORDER_DATE COLUMN).  Now, I want to apply custom color for these 2 dates, example organge for max date and blue for min date. 

I guess data color option is moved to folIowing menu so I went into Format your Visual--> Visual --> bars --> applied colors manually for different dates, But next time when data refreshes it will be different dates so the power Bi is converting the colors to its default. 

My requirement over here is i want orange color for the max date and blue color for min date(When I drop ORDER _DATE to Legends, Conditional format(fx) is not visible next to bars(COLOR) in  format your visual tab.  

Note: I imported this data into POWER BI using direct query option with SQL and database connection.    

 

ORDER_DATEVENDORQUANTITY
13-FEB-20251A10
13-FEB-20252B20
13-FEB-20253C10
06-FEB-20251A15
06-FEB-20252B25
06-FEB-20253C 35

 Please help me with this requirement. 

 Thank you! 

Power BI February 2025 PowerBI desktop Release Power BI Desktop Version Issue  Power BI Clustered Column Chart Conditional formatting and Analytic line in Power BI Service Default Power BI colors for Data Bars 

 

2 ACCEPTED SOLUTIONS
Shravan133
Super User
Super User

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.

View solution in original post

Anonymous
Not applicable

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:

vqiaqimsftv_1-1739501625706.png

 

vqiaqimsftv_0-1739501219187.png

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:

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

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:

vqiaqimsftv_1-1739501625706.png

 

vqiaqimsftv_0-1739501219187.png

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:

 

Shravan133
Super User
Super User

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.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.