Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
@curious_Member , 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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
94 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |