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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
derekli1700
Frequent Visitor

Need help with representing percentage differences in matrix table

Date of ActionCustomerVolumeTransactionAssets
13/01/2020Customer A              44,499.2             1,148               60
5/06/2021Customer A           145,243.4                 508             106
26/06/2022Customer A                     758.7                    15                  2
28/11/2023Customer A                 1,669.1                    29                  8
25/07/2024Customer A              15,330.9                 287               51
5/03/2020Customer B                 2,186.1                    16                  1
26/08/2021Customer B                     631.6                    16                  4
15/08/2023Customer B           220,562.9                 854               63
23/05/2024Customer B              26,053.9                 103               29
5/04/2022Customer C                 1,423.1                    32               12
31/03/2023Customer C              62,440.1                 214               58
4/08/2023Customer C                 2,245.7                    17                  1
6/03/2024Customer C              42,202.8                    58               12

This is a sample of my dataset that im putting into excel. Below is what the matrix table looks like on Power Bi

derekli1700_0-1723679964342.png

Is there a way to input columns next to "sum of assets", another next to "sum of transaction" and "sum of volume" that shows the decrease or increase as a percentage over the years? Ideally when we drill down and expand on the months - it will also show the percentage differences between the months too. Thanks!

 

1 ACCEPTED SOLUTION
v-kongfanf-msft
Community Support
Community Support

Hi @derekli1700 ,

 

Maybe you need create a Date table. And then try formula like below:

vkongfanfmsft_0-1723796114367.png

Assets_Pct_Change =
VAR CurrentYearAssets =
    SUM ( 'FactTable'[Assets] )
VAR PreviousYearAssets =
    CALCULATE ( SUM ( 'FactTable'[Assets] ), DATEADD ( 'Date'[Date], -1, YEAR ) )
RETURN
    DIVIDE ( CurrentYearAssets - PreviousYearAssets, PreviousYearAssets, 0 )
Transaction_Pct_Change =
VAR CurrentYearTransaction =
    SUM ( 'FactTable'[Transaction] )
VAR PreviousYearTransaction =
    CALCULATE (
        SUM ( 'FactTable'[Transaction] ),
        DATEADD ( 'Date'[Date], -1, YEAR )
    )
RETURN
    DIVIDE (
        CurrentYearTransaction - PreviousYearTransaction,
        PreviousYearTransaction,
        0
    )
Volume_Pct_Change =
VAR CurrentYearVolume =
    SUM ( 'FactTable'[Volume] )
VAR PreviousYearVolume =
    CALCULATE ( SUM ( 'FactTable'[Volume] ), DATEADD ( 'Date'[Date], -1, YEAR ) )
RETURN
    DIVIDE ( CurrentYearVolume - PreviousYearVolume, PreviousYearVolume, 0 )

vkongfanfmsft_1-1723796217043.pngvkongfanfmsft_2-1723796234960.png


Best Regards,
Adamk Kong

 

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

3 REPLIES 3
v-kongfanf-msft
Community Support
Community Support

Hi @derekli1700 ,

 

Maybe you need create a Date table. And then try formula like below:

vkongfanfmsft_0-1723796114367.png

Assets_Pct_Change =
VAR CurrentYearAssets =
    SUM ( 'FactTable'[Assets] )
VAR PreviousYearAssets =
    CALCULATE ( SUM ( 'FactTable'[Assets] ), DATEADD ( 'Date'[Date], -1, YEAR ) )
RETURN
    DIVIDE ( CurrentYearAssets - PreviousYearAssets, PreviousYearAssets, 0 )
Transaction_Pct_Change =
VAR CurrentYearTransaction =
    SUM ( 'FactTable'[Transaction] )
VAR PreviousYearTransaction =
    CALCULATE (
        SUM ( 'FactTable'[Transaction] ),
        DATEADD ( 'Date'[Date], -1, YEAR )
    )
RETURN
    DIVIDE (
        CurrentYearTransaction - PreviousYearTransaction,
        PreviousYearTransaction,
        0
    )
Volume_Pct_Change =
VAR CurrentYearVolume =
    SUM ( 'FactTable'[Volume] )
VAR PreviousYearVolume =
    CALCULATE ( SUM ( 'FactTable'[Volume] ), DATEADD ( 'Date'[Date], -1, YEAR ) )
RETURN
    DIVIDE ( CurrentYearVolume - PreviousYearVolume, PreviousYearVolume, 0 )

vkongfanfmsft_1-1723796217043.pngvkongfanfmsft_2-1723796234960.png


Best Regards,
Adamk Kong

 

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

@v-kongfanf-msft hi - the calculations doesnt seem to work when you drill down into month? It works for YOY difference but no month by month difference? Thanks

ryan_mayu
Super User
Super User

maybe you can try DATEADD function to get next month's value

 

https://learn.microsoft.com/en-us/dax/dateadd-function-dax?wt.mc_id=DP-MVP-5004616





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

Proud to be a Super User!




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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