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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

Logic for Implementing Traffic Light

Hello All,

 

One query here on DAX logic to be used.

 

I'm trying to implement a traffic light logic to show Red/Green depending on whether the target is achieved or not. 

 

I have simplified the problem statement to below data. 

 

Target= $500 Sales in 5 years (i.e.  $100 every year)

We have 5 categories to achieve this $500 sales

eg. Cookies, Chocolates, Cakes, Pastry, and Savoury

Therefore, using equal distribution, every category should achieve $20 Sales in a year. (this would be the target).

 

Pretty straightforward, I can compare the actual sales w.r.t. Target ($20 in this case), and develop traffic light.

 

But let's say in the first year the Actual Sales was only $60 across 5 categories instead of $100. 

In that case, the target would now change to ($500-$60)= $440 in the next 4 years. 

i.e. $110 for each year. 

Therefore, category wise target would then change to $110/5 = $22 per year for a category.

 

How do I address this complication year on year where it would compare the actual sales and correspondingly adjust the target for the coming years. 

 

PB Query.JPG

 

Note: The categories (5 to start with) are not fixed, it might change in Year 3 to either 6 or 4. But Target of $500 will be constant

 

Thank you 🙂

 

 

 

 

 

 

 

2 REPLIES 2
kentyler
Solution Sage
Solution Sage

So target for a given year is 500 - total sales for previous years / number of remaining years

target for a given category is target for that year/number of categories

Is that the logic you want ?





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


Anonymous
Not applicable

Yes, that's right.

Thanks.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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