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

Show growth percentage rather than values

Is there an easy way to rather than showing the value but to show the percentage difference between year on year? so the percentage growth from 2016 to 2017 then 2017 to 2018 and finally 2018 to 2019

 

21r1r.JPG

4 REPLIES 4
Anonymous
Not applicable

Hi

 

You can use the following measures 🙂

OBS: you maight have to change ; to , in the code.

 

CurrentYear = SUM(Your[Value])
LastYear =
    VAR MonthsWithSales =
        FILTER (
            VALUES ( 'Calendar'[Date] );
            [CurrentYear] > 0
        )
    RETURN
    CALCULATE(
        CALCULATE([CurrentYear];SAMEPERIODLASTYEAR('Calendar'[Date]));
        MonthsWithSales
    )
GrowthPct =
    VAR MonthsWithSales =
        FILTER (
            VALUES ( 'Calendar'[Date] );
            [CurrentYear] > 0 && [LastYear] > 0
        )
    VAR CY = CALCULATE([CurrentYear];MonthsWithSales)
    VAR LY = CALCULATE([LastYear];MonthsWithSales)
    VAR Result =    
    IF (
            NOT ISBLANK ( CY );
            DIVIDE (
                CY-LY;
                LY
            )
        )
    RETURN
 
Remember that you must have calender dates without gaps.
Therefore did i use the following code to create a calender tabel.
OBS: remember to create the relationship in your model.
 
Calender =
VAR MinYear = YEAR ( MIN ( Your[Date]) )
VAR MaxYear = YEAR ( MAX ( Your[Date]) )
RETURN
ADDCOLUMNS (
    FILTER (
        CALENDARAUTO( );
        AND ( YEAR ( [Date] ) >= MinYear; YEAR ( [Date] ) <= MaxYear )
    );
    "Calendar Year"; YEAR ( [Date] );
    "Month Name"; FORMAT ( [Date]; "mmmm" );
    "Month Number"; MONTH ( [Date] );
    "Weekday"; FORMAT ( [Date]; "dddd" );
    "Weekday number"; WEEKDAY( [Date] );
    "Quarter"; "Q" & TRUNC ( ( MONTH ( [Date] ) - 1 ) / 3 ) + 1
)
        Result
 
 
kcantor
Community Champion
Community Champion

@Anonymous 

To show the percentage you would need to create calculations to show the percentage and display them on the visual.

If you have the growth number already calculated, simply create a measure to divide the growth number by the total from the prior year.

Additional information on these calculations can be found here: https://powerbi.tips/2016/12/measures-year-over-year-percent-change/





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

@kcantor  thank you fro the response, no i dont have a growth number calculated yet that would need to be created

 

 

@Anonymous 

See this resource for creating those calculations. I added it to my last post a little after the fact.

https://powerbi.tips/2016/12/measures-year-over-year-percent-change/

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.