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
Linda200
Frequent Visitor

Percentage change measure by row

I am pretty new to creating measures and hope someone can help wih this.

 

I am wanting to calulate % change between two columns (2 different years) but would also like the results to be further broken down by categories (i.e. different markets) that are contained in rows. The measure I have just creates the total % change. This is the measure I am using:

 

Expenditure growth 2016 to 2017 =
VAR __BASELINE_VALUE = SUM('Volume and Exp 2016'[Expenditure])
VAR __VALUE_TO_COMPARE = SUM('Volume and Exp 2017'[Expenditure])
RETURN
    IF(
        NOT ISBLANK(__VALUE_TO_COMPARE),
        DIVIDE(__VALUE_TO_COMPARE - __BASELINE_VALUE, __BASELINE_VALUE)
    )
 
Any help is appreciated!
1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

 

Ideally you should append the two datasets (Give a name to this appended dataset as Data).  Then create a Calendar Table and build a relationship from the Date column of the appended dataset to the Date column of the Calendar Table.  In the Calendar Table, extract Year and Month by using the following calculated column formulas: Year = Year(Calendar[Date]) and Month = FORMAT(Calendar[Date],"mmmm").  In your visual, drag Yea from the Calendar Table (along with other fieldd such as Categories.  Write these measures:

 

Total Expenditure = SUM(Data[Expenditure])

Total Expenditure LY = CALCULATE([Total Expenditure],PREVIOUSYEAR(Calendar[Date]))

Growth in expenditure (%) = IFERROR([Total Expenditure]/[Total Expenditure LY],BLANK())

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

 

Ideally you should append the two datasets (Give a name to this appended dataset as Data).  Then create a Calendar Table and build a relationship from the Date column of the appended dataset to the Date column of the Calendar Table.  In the Calendar Table, extract Year and Month by using the following calculated column formulas: Year = Year(Calendar[Date]) and Month = FORMAT(Calendar[Date],"mmmm").  In your visual, drag Yea from the Calendar Table (along with other fieldd such as Categories.  Write these measures:

 

Total Expenditure = SUM(Data[Expenditure])

Total Expenditure LY = CALCULATE([Total Expenditure],PREVIOUSYEAR(Calendar[Date]))

Growth in expenditure (%) = IFERROR([Total Expenditure]/[Total Expenditure LY],BLANK())

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks. This helps!

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.