Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi All
I have two tables with A and B which was created from sqlsever. Table A has Actual Sales and Table B has Target Sales. Both Tables are related based on a Column WeekNumber . I want to perform conditional formatting on Actuals sales column (TableA) by highlighting the Actual Sales in Green Color if the Target Sales (TableB) is achieved for the corresponding week and city, and if not, then Red color.
What conditional formatting rule I have to apply ?
Thanks!
Solved! Go to Solution.
Hi, @Anonymous
According to your description, you want to set the conditional formatting of [Actual sales] according to the comparison of data, you can try my steps:
Color =
var _target=
CALCULATE(MAX('Table B'[Target sales]),FILTER('Table B',[City]=MAX('Table A'[City])&&[Week]=MAX('Table A'[Week])))
return
IF(MAX('Table A'[Actual sales])>=_target,"Green","Red")
You can download my test pbix file here
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous
According to your description, you want to set the conditional formatting of [Actual sales] according to the comparison of data, you can try my steps:
Color =
var _target=
CALCULATE(MAX('Table B'[Target sales]),FILTER('Table B',[City]=MAX('Table A'[City])&&[Week]=MAX('Table A'[Week])))
return
IF(MAX('Table A'[Actual sales])>=_target,"Green","Red")
You can download my test pbix file here
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
77 | |
74 | |
57 | |
40 | |
33 |
User | Count |
---|---|
70 | |
63 | |
57 | |
49 | |
46 |