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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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