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
idriss
Regular Visitor

Calculating the cost of the current month with the last month

Greetings Power Bi Community.

 

I'm new to Power Bi and i'm trying to calculate the Cumulative Planned Value from (EVM)

 

 

Capture.PNG

 

 I want to calculate the Cumulative Planed Value, and the formula i used is :

    CPV (for each column) = TBC(of the column ) + TBC(of the column before)

 

Any assistance would be appreciated.

1 ACCEPTED SOLUTION

Hi @v-ljerr-msft

 

Thank you so much for everything. after adjusting the formula you gave me. I was able to calculate the Cumulative Planed Value.

the correct furmula is below :

 

CPV =
CALCULATION (
          SUM( 'Table1'[TBC] ,
          FILTER (
                ALL ( 'Table1' ,
                        'Table1'[Month] <= EARLIER (  'Table1'[Month] )

                        )
    )

And again thank you.

good day.

View solution in original post

4 REPLIES 4
v-ljerr-msft
Employee
Employee

Hi @idriss,

 

Without knowing your table structures, it's hard do write the formula which works exactly on your side. The formula below is for your reference. Smiley Happy

CPV =
VAR currentYear =
    MAX ( 'Table1'[Year] )
VAR currentMonth =
    MAX ( 'Table1'[Month] )
RETURN
    CALCULATE (
        SUM ( 'Table1'[TBC] ),
        FILTER (
            ALL ( 'Table1' ),
            'Table1'[Year] = currentYear
                && 'Table1'[Month] <= currentMonth
        )
    )

Note: You'll need to replace the bold with your real table name and column name.

 

Regards

Hi @v-ljerr-msft

 

Thank you for the reply. I've tried your formula the result is just the total of everything.

I guess the problem is how to transform that table to relational table. 

If you have any clues, i'll be greatful.

Hi @idriss,

 

Could you post your real table structures(including the relationship) with some sample\mock data and the expected result, so that we can further assist on this issue? It's better to just share a sample pbix file(with some mock data). You can upload it to OneDrive or Dropbox and post the link here. Do mask sensitive data before uploadingSmiley Happy

 

Regards

Hi @v-ljerr-msft

 

Thank you so much for everything. after adjusting the formula you gave me. I was able to calculate the Cumulative Planed Value.

the correct furmula is below :

 

CPV =
CALCULATION (
          SUM( 'Table1'[TBC] ,
          FILTER (
                ALL ( 'Table1' ,
                        'Table1'[Month] <= EARLIER (  'Table1'[Month] )

                        )
    )

And again thank you.

good day.

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.