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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
CHR15F1T2
Regular Visitor

How to add variable percentage reduction to different products

Hi folks, newbie so pls go easy, still finding my feet.

I have a data table which contains product sales.  I have created measures to consider year-on-year change in sales performance and against 3-year average.  The one thing I'm struggling to do is show how each product is performing against target.  On 1 product I have to increase sales by 3% against the 3-yr ave but with another it's 10%.  Some products I've only to improve sales versus previous year.  Can I create 1 measure that uses different % change targets or do I need to do this in my source data?  Hope that makes sense.

1 ACCEPTED SOLUTION
speedramps
Community Champion
Community Champion

Hi Chris 
 
This assumes you have 1 record per product per year (otherwise average calculation wont give desired results)
 
 
Create a list of target percentages. 
Product, target +/- %, based on years
A,10,3
B,5,1
C,3,2
D,-12,3
 
Eg
product D decrease -12% based on 3 year ave
Product B increase 5% based on previous 1 year average
 
 
Create a 1:m relationship to your sales table
 
Create measure
 
Forecastsales =
VAR mybaseyears = SELECTEDVALUE(targets[baseyear])
 
VAR mybasedate=
DATEADD(TODAY(),- mybaseyears,year)
 
VAR myave =
CALCULATE(
AVE(yourtable[sales],
ALLEXCEPT(yourtable[product],
yourtable[date] >= mybasedate
)
 
VAR uplift = 
1+
(SELECTEDVALUE(targets[target])
/100) 
 
RETURN 
myave * uplift
 
 
Please click thumbs up and accept as solution.
 
One problem per ticket. If you need to refine your problem then please accept this solution and raise new tickets. Thanks.

View solution in original post

2 REPLIES 2
speedramps
Community Champion
Community Champion

Hi Chris 
 
This assumes you have 1 record per product per year (otherwise average calculation wont give desired results)
 
 
Create a list of target percentages. 
Product, target +/- %, based on years
A,10,3
B,5,1
C,3,2
D,-12,3
 
Eg
product D decrease -12% based on 3 year ave
Product B increase 5% based on previous 1 year average
 
 
Create a 1:m relationship to your sales table
 
Create measure
 
Forecastsales =
VAR mybaseyears = SELECTEDVALUE(targets[baseyear])
 
VAR mybasedate=
DATEADD(TODAY(),- mybaseyears,year)
 
VAR myave =
CALCULATE(
AVE(yourtable[sales],
ALLEXCEPT(yourtable[product],
yourtable[date] >= mybasedate
)
 
VAR uplift = 
1+
(SELECTEDVALUE(targets[target])
/100) 
 
RETURN 
myave * uplift
 
 
Please click thumbs up and accept as solution.
 
One problem per ticket. If you need to refine your problem then please accept this solution and raise new tickets. Thanks.

Many thanks for such a prompt response @speedramps .  I have a seperate SQL view that has the product sales aggregated so I will do as you suggest using that approach.  Very grateful for your time.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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