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 September 15. Request your voucher.

Reply
pasno
Helper II
Helper II

Add column to a matrix with % of increase vs previous week

Hello guys,

 

I'm working with a matrix, and I conted the number of whipment splitted by Area (rows) and year-month (columns).

I'd like to add one more column, but I fond some issues when I try to create the new measure.

 

My idea is to create a column that shows the % of variation in comparison with the last n months (let's say 2 month).

So, for example, the measure for March for the 2° row will make this calculation:

Average(13:16) [average of 2° row monhts January and February]

/

24 [value of 2° row for March]

 

Do you have any idea to help me?

 

Thank you very much!!

 

Num ship.PNG

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @pasno ,

 

1.Create a calendar table.

Calendar =
ADDCOLUMNS (
   CALENDAR ( MIN ( 'Table'[Date] ), MAX ( 'Table'[Date] ) ),
    "YearMonth",
        YEAR ( [Date] ) & "-"
            & MONTH ( [Date] )
)

1.png2.png

 

2.Create a What-if parameter and put it into a slicer.

3.png4.png

 

3.Create this measure.

Percentage = 
DIVIDE (
    DIVIDE (
        CALCULATE (
            SUM ( 'Table'[Value] ),
            DATESINPERIOD ( 'Calendar'[Date], LASTDATE ( 'Table'[Date] ), -3, MONTH )
        )
            - SUM ( 'Table'[Value] ),
        [Parameter Value]
    ),
    SUM ( 'Table'[Value] )
)

5.png

 

You can check more details from here.

 

 

 

Best Regards,

Stephen Tao

 

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

2 REPLIES 2
Anonymous
Not applicable

Hi @pasno ,

 

1.Create a calendar table.

Calendar =
ADDCOLUMNS (
   CALENDAR ( MIN ( 'Table'[Date] ), MAX ( 'Table'[Date] ) ),
    "YearMonth",
        YEAR ( [Date] ) & "-"
            & MONTH ( [Date] )
)

1.png2.png

 

2.Create a What-if parameter and put it into a slicer.

3.png4.png

 

3.Create this measure.

Percentage = 
DIVIDE (
    DIVIDE (
        CALCULATE (
            SUM ( 'Table'[Value] ),
            DATESINPERIOD ( 'Calendar'[Date], LASTDATE ( 'Table'[Date] ), -3, MONTH )
        )
            - SUM ( 'Table'[Value] ),
        [Parameter Value]
    ),
    SUM ( 'Table'[Value] )
)

5.png

 

You can check more details from here.

 

 

 

Best Regards,

Stephen Tao

 

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

amitchandak
Super User
Super User

@pasno ,

For Week vs Week  please refer

https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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