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
Billy0503
Frequent Visitor

Calculate totals between rows

Hello everyone,

 

I need some urgent help with this one. I need to show the changes of the Total values, between the single forecast dates. 

 

PowerBi.PNG

 

As in the Excel example the forecast date 01-2017 has the total value of 218.163, the change to the next forecast date (02-2017) is 13.700, and so on.

 

Is it possible to do it in Power Bi like in the excel example? If yes, do anyone have any idea?

 

Example.PNG

 

 

Thank you guys in advance for your help 🙂

1 ACCEPTED SOLUTION
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @Billy0503,

 

To calculate the changes, you can firstly calculate the values of last month, then it should be easy to get the changes. The formula below is for your reference. Smiley Happy

Changes =
VAR currentYear =
    MAX ( 'Table'[Year] )
VAR currentMonth =
    MAX ( 'Table'[Year] )
RETURN
    SUM ( 'Table'[Values] )
        - CALCULATE (
            SUM ( 'Table'[Values] ),
            FILTER (
                ALL ( 'Table' ),
                'Table'[Year] = currentYear
                    && 'Table'[Month]
                    = currentMonth - 1
            )
        )

 

Regards

View solution in original post

2 REPLIES 2
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @Billy0503,

 

To calculate the changes, you can firstly calculate the values of last month, then it should be easy to get the changes. The formula below is for your reference. Smiley Happy

Changes =
VAR currentYear =
    MAX ( 'Table'[Year] )
VAR currentMonth =
    MAX ( 'Table'[Year] )
RETURN
    SUM ( 'Table'[Values] )
        - CALCULATE (
            SUM ( 'Table'[Values] ),
            FILTER (
                ALL ( 'Table' ),
                'Table'[Year] = currentYear
                    && 'Table'[Month]
                    = currentMonth - 1
            )
        )

 

Regards

You are a genius 🙂 Thanks a lot for your help @v-ljerr-msft

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.