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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Calculating month-to-month percentage changes in a value

Hi all - we are trying to display month-to-month and year-to-year percentage changes in profit using Power BI. Our data is sorted per transaction, with columns for the date and profit per sale. Is there a DAX formula we can use?

 

The number of sales per month are in the 1,000s and are broken down to specific days, not months (although the month is included in the value).

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

@Anonymous ,

 

To be general. you can achieve Month-Total by creating a calculate column using DAX like pattern below:

 

Month Total = TOTALYTD(SUM(Table[Value]),Table[Date])

Then you can achieve the percentave changes every month by create another calculate column using DAX like pattern below:

Percentage Change =
VAR Current_Month =
    MONTH ( Table[Date] )
VAR Previous_Month = Current_Month - 1
VAR Current_Month_Value =
    CALCULATE (
        MAX ( Table[Month Total] ),
        FILTER ( Table, MONTH ( Table[Date] ) = Current_Month )
    )
VAR Previous_Month_Value =
    CALCULATE (
        MAX ( Table[Month Total] ),
        FILTER ( Table, MONTH ( Table[Date] ) = Previous_Month )
    )
RETURN
    ( Current_Month_Value - Previous_Month_Value ) / Previous_Month_Value

Community Support Team _ Jimmy 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

1 REPLY 1
v-yuta-msft
Community Support
Community Support

@Anonymous ,

 

To be general. you can achieve Month-Total by creating a calculate column using DAX like pattern below:

 

Month Total = TOTALYTD(SUM(Table[Value]),Table[Date])

Then you can achieve the percentave changes every month by create another calculate column using DAX like pattern below:

Percentage Change =
VAR Current_Month =
    MONTH ( Table[Date] )
VAR Previous_Month = Current_Month - 1
VAR Current_Month_Value =
    CALCULATE (
        MAX ( Table[Month Total] ),
        FILTER ( Table, MONTH ( Table[Date] ) = Current_Month )
    )
VAR Previous_Month_Value =
    CALCULATE (
        MAX ( Table[Month Total] ),
        FILTER ( Table, MONTH ( Table[Date] ) = Previous_Month )
    )
RETURN
    ( Current_Month_Value - Previous_Month_Value ) / Previous_Month_Value

Community Support Team _ Jimmy Tao

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

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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