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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Percent increase Calculation

I am quite new to Power BI world. I am trying to calculate and show the percentage growth for a column data. Let me illustrate:

 

Product                  Year                       Volume

Product 1               1/1/2019                   10

Product 1               1/1/2020                   15

Product 1               1/1/2021                   20

Product 2               1/1/2019                   35

Product 2               1/1/2020                   40

Product 2               1/1/2021                   45

 

I am trying to display the percentage growth between the 2019 and 2021 in a Card which will be unaffected even if I select any year for any other visual

 

 

1 ACCEPTED SOLUTION

Sorry, I'm assuming that you are using the auto-datetime hierarchy feature for the slicer. I don't normally use these myself. The following variation should fix this issue.

 

Growth = 
var volume2021 = CALCULATE(sum('Table'[Volume]),  'Table'[Year].[Year] = 2021)
var volume2019 = CALCULATE(sum('Table'[Volume]),'Table'[Year].[Year] = 2019)
return (volume2021 - volume2019) / volume2019

View solution in original post

4 REPLIES 4
d_gosbell
Super User
Super User


@Anonymous wrote:

I am trying to display the percentage growth between the 2019 and 2021 in a Card which will be unaffected even if I select any year for any other visual


You could do that with a measure like the following

Growth = 
var volume2021 = CALCULATE(sum('Table'[Volume]), Year('Table'[Year]) = 2021) 
var volumne2019 = CALCULATE(sum('Table'[Volume]), Year('Table'[Year]) = 2019)
return (volume2021 - volumne2019) / volumne2019
Anonymous
Not applicable

Thanks for quick reply. I tried your solution. It is not working. It shows 0% always. Then I created another measure for only 2019. It changed every time I select a year. Thats why the first measure is showing 0%.

Sorry, I'm assuming that you are using the auto-datetime hierarchy feature for the slicer. I don't normally use these myself. The following variation should fix this issue.

 

Growth = 
var volume2021 = CALCULATE(sum('Table'[Volume]),  'Table'[Year].[Year] = 2021)
var volume2019 = CALCULATE(sum('Table'[Volume]),'Table'[Year].[Year] = 2019)
return (volume2021 - volume2019) / volume2019
Anonymous
Not applicable

Thanks a lot. That worked well.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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