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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
alexoriginal
Frequent Visitor

Add two columns in matrix together

Hi

Just started using Power BI

Need to know how can I get the % change for the two corresponding months eg , Jan 2017  to  January 2018  ( please see image)

Capture2.PNG 

Thank you

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

 

Create a calendar Table and write the following calculated column formulas to extract Year and Month

 

Year=YEAR(Calendar[Date])

Month=FORMAT(Calendar[Date],"mmmm")

 

Create a relationship from Date column of your base data table to the Date column of your Calendar Table.  In your visual, drag Year and Month from the Calendar Table.  Write these measures

 

Values=SUM(Data[Value])

Values in same period last year=CALCULATE([Values],SAMEPERIODLASTYEAR(Calendar[Date]))

Growth in value over same period last year=[Values]/[Values in same period last year]

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @alexoriginal,

 

Can you share a dummy sample file? I'm afraid we can't add it directly. But maybe we can leverage the Total field like below.

Measure 10 =
IF (
    HASONEVALUE ( DimDate[YearMonth] ),
    SUM ( FactSales[SalesQuantity] ),
    DIVIDE (
        CALCULATE (
            SUM ( FactSales[SalesQuantity] ),
            FILTER ( ALL ( DimDate ), DimDate[YearMonth] = MIN ( DimDate[YearMonth] ) )
        ),
        CALCULATE (
            SUM ( FactSales[SalesQuantity] ),
            FILTER ( ALL ( DimDate ), DimDate[YearMonth] = MAX ( DimDate[YearMonth] ) )
        )
    )
)

Add_two_columns_in_matrix_together

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.