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
Gaul10
New Member

Measures: Absolute variation and Relative contribution

Good morning everyone,

 

i'm trying to create two new measures that allow me to identify how much every value has increased during the years.

Here an example of my table:

 

Year     Access     Application

2016    100          Mobile

2016    200          Desktop

2016    300          Tablet

2017    500          Mobile

2017    800          Desktop

2017    600          Tablet

2018    800          Mobile

2018    900          Desktop

2018    600          Tablet

 

So, the total accesses of each year would be:

2016 = 600

2017 = 1900

2018 = 2300

 

 

The measures i'm trying to crate must tell me the percentage increase/decrease of each application between the years in two way:

 

1) Absolute variation

2) Relative contribution

 

For example, taking Desktop as a reference:

 

2016 = 200

2017 = 800

2018 = 900

 

The absolute variation would be:

2016 --> 0%

2017 --> [(DesktopAccess2017/DesktopAccess2016)*100 ] -100 = [(800/200)*100] -100 = 300%

2018 --> 12.5%

 

The relative contribution would be:

2016 --> (DesktopAccess2016/TotalAccess2016)*100 --> (200/600)*100 = 33.3% 

2017 --> 42.1%

2018 --> 39.1%

 

 

How can i create these two measures?

 

Thank you for your help

1 ACCEPTED SOLUTION
alexei7
Continued Contributor
Continued Contributor

Hi Gaul10,

 

I think the following measures would work for you:

 

Absolute Variation = var CurrentYear = MAX(Table1[Year]) return
DIVIDE(sum(Table1[Access]),CALCULATE(sum(Table1[Access]),FILTER(ALLEXCEPT(Table1,Table1[Application]),Table1[Year]=CurrentYear-1)),0)-1

 

Relative Contribution = DIVIDE(SUM(Table1[Access]),CALCULATE(SUM(Table1[Access]),ALLEXCEPT(Table1,Table1[Year])),0)

View solution in original post

2 REPLIES 2
alexei7
Continued Contributor
Continued Contributor

Hi Gaul10,

 

I think the following measures would work for you:

 

Absolute Variation = var CurrentYear = MAX(Table1[Year]) return
DIVIDE(sum(Table1[Access]),CALCULATE(sum(Table1[Access]),FILTER(ALLEXCEPT(Table1,Table1[Application]),Table1[Year]=CurrentYear-1)),0)-1

 

Relative Contribution = DIVIDE(SUM(Table1[Access]),CALCULATE(SUM(Table1[Access]),ALLEXCEPT(Table1,Table1[Year])),0)

It works perfectly! 

Thank you alexei7

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.