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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
dmartiprev
Frequent Visitor

KPI Color

I have made this before but now it doesn't seem to work correctly.  I made a KPI tile of daily crude oil prices that i want to be green if the daily price change is positive and red if the daily price change is negative.  I have three columns of data in Table1: Date, Daily Price of Oil, and Oil Daily Price Change which is how much the price of oil has gone up or down since the previous day. 

 

I have also created a measure called: Last Oil Price Change = LASTNONBLANKVALUE('Table1'[Date],SUM('Table1'[Oil Daily Price Change])).   

 

I set the Values of the KPI tile to be the column of data for the Daily Price of Oil and the target for the KPI to be this measure.  Therefore, in the trend axis I set a rule for coloring if the measure Last Oil Price Change is >0 then green and if <0 then red.  However, this doens't seem to work.  any ideas what I'm doing wrong?

5 REPLIES 5
v-shex-msft
Community Support
Community Support

HI @dmartiprev,

If this formula does not work well on kpi visual, it means this expression internal functions and calculations not fully recognized and analysis in the visual.

Key Performance Indicator (KPI) visuals - Power BI | Microsoft Learn

Can you please share some more detail information about this issue? They should help us clarify your scenario and test to troubleshoot.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi @v-shex-msft ,

 

Really all I want to do is have a KPI that shows the "Daily Price of Oil" and will be red or green if the last "Oil Daily Price Change" was down or up from the previous day's price.  How do i do that?  I have three columns of data: "Date", "Daily Price of Oil", and "Oil Daily Price Change"

Here is a visual of the KPI,  the color should be red since the daily change is negative.Oil KPI.png

Hi @dmartiprev,

Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

I'm sorry I don't know how to attach a file on the reply.  I can send you an excel of this data to reproduce this result if you show me how to attach it.  Here is a small subset of this data that should produce the same result:

 

DateDaily Price of OilOil Daily Price Change
8/23/202165.653.4
8/24/202167.51.85
8/25/202168.541.04
8/26/202167.42-1.12
8/27/202168.841.42
8/30/202169.280.44
8/31/202168.43-0.85

 

Helpful resources

Announcements
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.