Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi everyone,
I am trying to apply the same font color conditional format for many columns using a measure instead of configure it using a rule manually to each column.
The idea is that if I want to change the rule in the future I can do it changing the DAX formula of the conditional format measure instead of change it in each column one by one.
Here is the example:
I have 1 table in my datasource:
TABLE 1: date, product, sales, forecast, quota
I created 4 measures:
MEASURE salesOverQuota = DIVIDE(SUM(sales)-SUM(quota), SUM(quota), 0)
MEASURE forecasOverQuota = DIVIDE(SUM(forecast)-SUM(quota), SUM(quota), 0)
MEASURE salesOverForecast = DIVIDE(SUM(sales)-SUM(forecast), SUM(forecast), 0)
MEASURE salesYoYGrowth(%) =
DIVIDE(
SUM(sales)
- CALCULATE(
SUM(sales)
CALCULATE(
SUM(sales)
In the report I included a matrix using product as rows and the measures as values.
To apply the same font color conditional format I created a new measure:
MEASURE overFontColor = IF(SELECTEDMEASURE() > 0, "#0D8224", "#FF0D00") --(green if true, red if false)
I select "overFontColor" as field value which should be based on the font color but it does not work (all values are red or green and the rule is not applied by cell values).
Any idea to solve the problem?
Thanks in advance.
@Anonymous , I checked this selectedmeasure couple of days back and this did work atleast with calculation group and it did not work
Using code given in my blog- I was able to get selected measure in case of field parameters, and check if that can help
check for selectedmeasure code
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
72 | |
70 | |
37 | |
29 | |
26 |
User | Count |
---|---|
91 | |
49 | |
45 | |
38 | |
37 |