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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

How to make Contribution to Growth formula

Hi,

 

 

I want to calculate a measure where I sum up the growth of all products that have growth vs. last year and in another measure, I want to aggregate the decline of all the products that have a decline. 

 

I've tried with

Growth=If([This Year] > [Last year]; [This Year]-[Last Year]) 

Decline=If[This Year]<[Last year];[This Year]-[Last Year])

 

It works on an aggregated level but it sums up the whole year and not per product. I would like to see both how much that is growth and how much that is decline...

 

Hope you can help

 

 

 

 

 

1 ACCEPTED SOLUTION

Hi @Anonymous,

 

You can create a calculated column like below to get values in last year same weeknr for the same product:

 

LastYearSameSKU-WEEKNR = LOOKUPVALUE(data[Value Sales'000],data[PRODUCT],'data'[PRODUCT],data[WEEKNR],'data'[WEEKNR],data[YEAR],'data'[YEAR]-1)

 

Best Regards,
QiuyunYu

Community Support Team _ Qiuyun Yu
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
Greg_Deckler
Community Champion
Community Champion

Add Product to your visual?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Thanks, @Greg_Deckler, I wished it was that simple - The visualization I use is a Stacked Column where I have growth, decline and value last year in three different column values and then Value this year in a Line, The 3 columns add up to this year's value.

 

When I have more than one value in Column values I cannot have anything in Column series...

 

image.png

 

 

 

 

 

 

 

 

 

 

 

 

On the chart above I should have both growths and decline in each period - Now I only have the net growth or decline.

 

In Excel I can fix it, so it should look something like this:

 

image.png

Hi @Anonymous,

 

It's expected that we can't add column to Column Series property if we already add more than one fields into Column Values section.

 

In your scenario, please share some sample data and show us the desired results, so we can test to see if your requirement can be achieved.

 

Best Regards,
QiuyunYu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thanks for coming back @v-qiuyu-msft.

 

You can find some data here:

https://www.dropbox.com/sh/vtld3ulkzqmi1ym/AAAxsCvX1DDnCa20e4WVsZ-0a?dl=0

 

I have been thinking - if I can add a column in the table that looks up last years sales on each SKU, Year, Period it should be easy. There is only one row per SKU/Period....

 

Thanks for looking into this!

 

Kent

Hi @Anonymous,

 

You can create a calculated column like below to get values in last year same weeknr for the same product:

 

LastYearSameSKU-WEEKNR = LOOKUPVALUE(data[Value Sales'000],data[PRODUCT],'data'[PRODUCT],data[WEEKNR],'data'[WEEKNR],data[YEAR],'data'[YEAR]-1)

 

Best Regards,
QiuyunYu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thank you very much @v-qiuyu-msft - It worked perfectly!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 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.