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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
crainaud
Frequent Visitor

KPI Tabular Editor color switch based on product

Hi,

I have set up my KPIs using Tabular Editor.  Generally an increase over target is a positive or "green" but I have one item where it should be "red".  

In the example below, I've actually used two matrix tables so it "appears" correctly on my screen, but I'd like to have the same results in one matrix table as this method doesn't always appear correctly on other users screens.

Looking for ideas on how this could be achieved.  All help is greatly appreciated.  Thanks.

crainaud_1-1633439337028.png

Carolyn

 

 

 

1 ACCEPTED SOLUTION

Hi -

Happy to report by studying an Enterprise DNA sample file, I figured out a switch measure that works for this situation.  The variance calculation is based on the specific metric that appears in the table visual.

 
MTD Var by Metric =
VAR CurrentItem = SELECTEDVALUE(Metrics[Metric] )

RETURN
SWITCH( TRUE(),
CurrentItem = "Net MWh", [MTD Var],
CurrentItem = "A Steam Klbs", [MTD Reverse Var],
CurrentItem = "B Steam Klbs", [MTD Var])
By using two difference variance measures; MTD Reverse Var (target - actual) and MTD Var (actual - target) I was able to create the Tabular Editor KPI to display the correct colors using the final measure MTD Var by Measure.

Yalan Wu, thanks for the follow-up!

View solution in original post

5 REPLIES 5
v-yalanwu-msft
Community Support
Community Support

Hi, @crainaud ;

Congratulations on finding a solution. Would you mind accept your replies as solutions? Then we are able to close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.

 

Best Regards,
Community Support Team_ Yalan Wu

v-yalanwu-msft
Community Support
Community Support

Hi, @crainaud ;

Can you share simple files after removing sensitive information? In addition, the desired output result is attached to solve this problem in more detail. The general idea is to use measure to make a conditional format. 

Looking forward to your reply!

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi -

Happy to report by studying an Enterprise DNA sample file, I figured out a switch measure that works for this situation.  The variance calculation is based on the specific metric that appears in the table visual.

 
MTD Var by Metric =
VAR CurrentItem = SELECTEDVALUE(Metrics[Metric] )

RETURN
SWITCH( TRUE(),
CurrentItem = "Net MWh", [MTD Var],
CurrentItem = "A Steam Klbs", [MTD Reverse Var],
CurrentItem = "B Steam Klbs", [MTD Var])
By using two difference variance measures; MTD Reverse Var (target - actual) and MTD Var (actual - target) I was able to create the Tabular Editor KPI to display the correct colors using the final measure MTD Var by Measure.

Yalan Wu, thanks for the follow-up!

amitchandak
Super User
Super User

@crainaud , can conditional icon formatting be used in this case? You can use measure and choice the icon set

 

refer if needed

https://exceleratorbi.com.au/conditional-formatting-using-icons-in-power-bi/

Thanks for getting back so quickly! 

I have used conditional formatting in the past, but was impressed with using Tabular Editor (TE) to create them.  Saves all that formatting.

I'm new to TE and had hoped to be able to find how to edit the KPI measures to switch the colors based on the product type.

 

 

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.