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 All
I get this expression from be from below post :-
Bar Color = IF(MAX('Date'[Date])>=DATE(2019,1,1), "Green", "Yellow")
I dont know how to make use of the above expression to make my month bar chart bar color change to yellow after covid 19 pandemic
Paul
Paul
Solved! Go to Solution.
Hi, @Anonymous
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Table:
You may create a measure as below.
Visual Control =
IF(
MAX('Table'[Date])>=DATE(2019,1,1),"Green","Yellow"
)
Then you need to make the visual selected, go to 'Visualizations', click 'Format' and set the 'fx' for 'Default color' in 'Data colors'.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Table:
You may create a measure as below.
Visual Control =
IF(
MAX('Table'[Date])>=DATE(2019,1,1),"Green","Yellow"
)
Then you need to make the visual selected, go to 'Visualizations', click 'Format' and set the 'fx' for 'Default color' in 'Data colors'.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous ,
Please check the below link. Let me know if anything that you want to know.
https://www.dropbox.com/s/3paix06o82v3fob/preWebinarPostCal_PY_DATA%20V008%20Working.pbix?dl=0
Regards,
Manikumar
Proud to be a Super User!
Hi Sir
Thank you very much for sharing , it work now , but i still not sure where to set , can you share with the screen shot ?
@Anonymous ,
Click on the fx button Under data colors
Then select Format By as Field Value and then choose the measure for the color.
Regards,
Manikumar
If you find this is helpful, Accept as a Solution and leave a like.
Proud to be a Super User!
Hi Sir
Thank you very much for sharing the 2 screen shot , very sorry i still cannot locate where to paste the script to Affordability. Below is the screen shot from the doc.
@Anonymous ,
You have to create a measure and use that for the coloring.
Regards,
Manikumar
Proud to be a Super User!
Hi Sir
Very sorry for the below chart you have create for me , may i know where you put the expression for make the 2 bar color turn to yellow ? i still cannot locate it.
@Anonymous ,
Under the data colors, you can see an option like fx, click on fx and choose format by as field value and select the field with the measure you created.
Rgeards,
Manikumar
Proud to be a Super User!
@Anonymous , Under data value, You will get an fx icon near to color.
Click on that and then pop up will open in that choose "field value" and this meausre.
This will only work in bar when you have only one measure and no legend
Refer
https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-numbers-in-the-column
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values
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.