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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Hari77
Regular Visitor

Need to change color of value where comparing forecast revenue with revenue .

Hi ,

I have forecast revenue for 12 months for current year. I have revenue from business central. Need to change the color of the value font where forecast revenue is less than revenue then it should be red color and forecast revenue greater than revenue it should be green color.  Forecast revneue table has month name and Forecast revenue . Revenue column has Date table.How to make this one?

Hari77_0-1734004215745.png

Since 2024 is current year need to change the color only for 2024. Thanks in advance.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Hari77 

 

Thank you very much Ajithkumar_03 and lkalawski for your prompt reply.

 

For your question, here is the method I provided:

 

Here's some dummy data

 

vnuocmsft_0-1734417418876.png

Create a measure.

 

Measure = 
VAR ForecastRevenue = SELECTEDVALUE('Table'[Value])
VAR Revenue = 
CALCULATE(
    AVERAGE('Table'[Value]),
    FILTER(
        ALL('Table'),
        'Table'[Year] = 2024
    )
)
RETURN
IF(
    SELECTEDVALUE('Table'[Year]) = 2024
    &&
    ForecastRevenue > Revenue,
    "Green",
    IF(
        SELECTEDVALUE('Table'[Year]) = 2024
        &&
        ForecastRevenue < Revenue,
        "Red"
    )
)

 

Step 1:

 

vnuocmsft_1-1734417813315.png

 

Step 2:

 

vnuocmsft_2-1734417949036.png

 

Here is the result.

 

vnuocmsft_3-1734418014946.png

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

 

 

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @Hari77 

 

Thank you very much Ajithkumar_03 and lkalawski for your prompt reply.

 

For your question, here is the method I provided:

 

Here's some dummy data

 

vnuocmsft_0-1734417418876.png

Create a measure.

 

Measure = 
VAR ForecastRevenue = SELECTEDVALUE('Table'[Value])
VAR Revenue = 
CALCULATE(
    AVERAGE('Table'[Value]),
    FILTER(
        ALL('Table'),
        'Table'[Year] = 2024
    )
)
RETURN
IF(
    SELECTEDVALUE('Table'[Year]) = 2024
    &&
    ForecastRevenue > Revenue,
    "Green",
    IF(
        SELECTEDVALUE('Table'[Year]) = 2024
        &&
        ForecastRevenue < Revenue,
        "Red"
    )
)

 

Step 1:

 

vnuocmsft_1-1734417813315.png

 

Step 2:

 

vnuocmsft_2-1734417949036.png

 

Here is the result.

 

vnuocmsft_3-1734418014946.png

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

 

 

Ajithkumar_03
Frequent Visitor

Hi @Hari77 ,

You can use conditional formating here.

Ajithkumar_03_0-1734006645952.png
use the following steps to achieve.
Create one measure like Sameperiodlast year

Ajithkumar_03_1-1734008712827.png

Then create measure called Conditional formating(CF)

Ajithkumar_03_2-1734008808145.png


Then apply conditionlal formating 

Ajithkumar_03_3-1734009127414.png

 


Best Regards,
Ajith Kumar

Did I answer your question? Mark my post as a solution!

I need to do only for current year. Forecast revenue Vs Actual revenue needs to be the comparison.Forecast > Actual the font red color, forecast < Actual the font green color . Actual revenue has last 3 years data .Need to do only for current year ,Please help me.

Forecast revenue and Revenue table is there. Forecast table has only Jan to Dec current year forecast revenue data . Revenue has current and last 2 years data . Need to write dax where Current year revenue less than Forecast revenue then red color font ,Current year revenue greater than Forecast revenue then red color font .Need to do this by checking Jan forecast vs Jan Revenue till December it needs to be compare for current year all months .How to do this in dax.

lkalawski
Resident Rockstar
Resident Rockstar

Hi @Hari77 ,

 

To add a dynamically changing font color, you need to create logic (a measure) that checks if one value is greater than the other.

Font Conditional = 
If([Forecast Revenue] < [Revenue], 1, 0)

Once you have that, you can use conditional formatting for font color and thus dynamically get the color to change.

 

lkalawski_0-1734006299878.png

lkalawski_1-1734006472786.png

 

PBI_SuperUser_Rank@1x.pngResident Rockstar | Former Super User
If I helped, please accept the solution and give kudos! 
Connect with me
Linkedin

 

 

Forecast revenue and Revenue table is there. Forecast table has only Jan to Dec current year forecast revenue data . Revenue has current and last 2 years data . Need to write dax where Current year revenue less than Forecast revenue then red color font ,Current year revenue greater than Forecast revenue then red color font .Need to do this by checking Jan forecast vs Jan Revenue till December it needs to be compare for current year all months .How to do this in dax.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.