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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Sunilrane
New Member

How to calculate % Change

Hi everyone,

I need some help to calculate percentage change of the following example pasted below

 

[All Periods][$]
CYTD Wks - 5   02/05/22$1,452,541,355
CYTD Wks PY - 5    02/05/21$77,139,973
Latest 13 Wks -   02/05/22$3,545,800,901
Latest 13 Wks PY -   02/05/21$173,655,357
Latest 4 Wks -   02/05/22$1,052,303,407
Latest 4 Wks PY-   02/05/21$56,642,000
Latest 52 Wks -   02/05/22$8,767,361,949
Latest 52 Wks PY -   02/05/21$414,221,751

 

Thanks and Regards, 

Sunil Rane

1 ACCEPTED SOLUTION
v-jinweili-msft
Microsoft Employee
Microsoft Employee

Hi @Sunilrane,

 

It seems that there are only two columns in your table:

vjinweilimsft_0-1646287683732.png

So you may create two columns to extract the Date and the Type:

Date =
RIGHT ( [[All Periods]]], 8 )
Type =
VAR _findWks =
    FIND ( "Wks", [[All Periods]]] )
RETURN
    LEFT ( [[All Periods]]], _findWks + 2 )

 

Output:

vjinweilimsft_1-1646287819702.png

 

Then create a measure 

Changed Percentage =
VAR _current =
    SUM ( 'Table'[[$]]] )
VAR _previous =
    CALCULATE (
        SUM ( 'Table'[[$]]] ),
        FILTER (
            ALL ( 'Table' ),
            [Type] = MAX ( 'Table'[Type] )
                && YEAR ( [Date] )
                    = YEAR ( MAX ( 'Table'[Date] ) ) - 1
        )
    )
RETURN
    DIVIDE ( _previous, ( _current - _previous ) )

And change the format to Percentage

vjinweilimsft_3-1646289176938.png

 

The final output:

vjinweilimsft_4-1646289223610.png

Best Regards,
Jinwei Li
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

4 REPLIES 4
v-jinweili-msft
Microsoft Employee
Microsoft Employee

Hi @Sunilrane,

 

It seems that there are only two columns in your table:

vjinweilimsft_0-1646287683732.png

So you may create two columns to extract the Date and the Type:

Date =
RIGHT ( [[All Periods]]], 8 )
Type =
VAR _findWks =
    FIND ( "Wks", [[All Periods]]] )
RETURN
    LEFT ( [[All Periods]]], _findWks + 2 )

 

Output:

vjinweilimsft_1-1646287819702.png

 

Then create a measure 

Changed Percentage =
VAR _current =
    SUM ( 'Table'[[$]]] )
VAR _previous =
    CALCULATE (
        SUM ( 'Table'[[$]]] ),
        FILTER (
            ALL ( 'Table' ),
            [Type] = MAX ( 'Table'[Type] )
                && YEAR ( [Date] )
                    = YEAR ( MAX ( 'Table'[Date] ) ) - 1
        )
    )
RETURN
    DIVIDE ( _previous, ( _current - _previous ) )

And change the format to Percentage

vjinweilimsft_3-1646289176938.png

 

The final output:

vjinweilimsft_4-1646289223610.png

Best Regards,
Jinwei Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

BeaBF
Super User
Super User

@Sunilrane If you have a Table named Tabella 5 like this:

BeaBF_0-1646246798773.png

you can calculate the percentage change between the same period of the two years with this measure:

Misura 2 =
VAR MAXD = CALCULATE(MAX('Tabella (5)'[Date]))
VAR SUMMAX = CALCULATE(SUM('Tabella (5)'[[$]]]),'Tabella (5)'[Date] = MAXD)
VAR PREVYE = CALCULATE(SAMEPERIODLASTYEAR('Tabella (5)'[Date]))
VAR SUMPREV = CALCULATE(SUM('Tabella (5)'[[$]]]),'Tabella (5)'[Date] = PREVYE)
RETURN SUMMAX - PREVYE
 
BF
BeaBF
Super User
Super User

@Sunilrane Hi!

Percentage change between...? Can you paste the expected result?

 

BF

Tanushree_Kapse
Impactful Individual
Impactful Individual

Hi @Sunilrane ,

 

Can you please share the properly formatted table. It's not very clear with this one.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.