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

Calculated Measure of values in same column

I have a table that I add a new snapshot of data to monthly. The date the new data is entered is the Snapshot Date column (Screenshot - Forecasted Data Table attached). I would like to calculate the difference in the column 'Recognized + Projected Revenue (CAD)' between Snapshots. For Example: I would like the Difference in 'Recognized + Projected Revenue (CAD)' in 'Snapshot Date' "May 2016" and 'Snapshot Date' "June 2016" for project = "X" at 'Date' = "July 2016".

 

I have also attached a picture of how I have configured my Matrix that is displaying the data.

 

Any help would be very appreciated.

 

 

Forecasted Data Table.PNG                   Matrix Config.PNG

1 ACCEPTED SOLUTION
v-haibl-msft
Employee
Employee

@eblake

 

You can do it with several slicers and tables as below. We only need to create a column and measure with following DAX formula.

I’ve also upload my .pbix file here for reference.

Date YearMonth = 
FORMAT ( 'Forecasted Data'[Date], "mmmm yyyy" )
Diff = 
CALCULATE (
    SUM ( 'Forecasted Data'[Recognized + Projected Revenue (CAD)] ),
    FILTER (
        'Forecasted Data',
        'Forecasted Data'[Snapshot Date] = MAX ( 'Forecasted Data'[Snapshot Date] )
    )
)
    - CALCULATE (
        SUM ( 'Forecasted Data'[Recognized + Projected Revenue (CAD)] ),
        FILTER (
            'Forecasted Data',
            'Forecasted Data'[Snapshot Date] = MIN ( 'Forecasted Data'[Snapshot Date] )
        )
)

Calculated Measure of values in same column_1.jpg

 

Best Regards,

Herbert

View solution in original post

3 REPLIES 3
v-haibl-msft
Employee
Employee

@eblake

 

You can do it with several slicers and tables as below. We only need to create a column and measure with following DAX formula.

I’ve also upload my .pbix file here for reference.

Date YearMonth = 
FORMAT ( 'Forecasted Data'[Date], "mmmm yyyy" )
Diff = 
CALCULATE (
    SUM ( 'Forecasted Data'[Recognized + Projected Revenue (CAD)] ),
    FILTER (
        'Forecasted Data',
        'Forecasted Data'[Snapshot Date] = MAX ( 'Forecasted Data'[Snapshot Date] )
    )
)
    - CALCULATE (
        SUM ( 'Forecasted Data'[Recognized + Projected Revenue (CAD)] ),
        FILTER (
            'Forecasted Data',
            'Forecasted Data'[Snapshot Date] = MIN ( 'Forecasted Data'[Snapshot Date] )
        )
)

Calculated Measure of values in same column_1.jpg

 

Best Regards,

Herbert

Greg_Deckler
Super User
Super User

Can you provide some sample data and information on expected output that we could use to engineer a solution?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hello,

I have attached a screenshot of a sample ot put table, I have a matrix formatted like this table, just missing the differnce column. I have also pasted in a sample of the table I am using for the raw data.

Sample Output.PNG

Snapshot DateDateCompanyProjectProject ClientProject Project stageProject Billable ProjectProject Customer Contract TypeProject First booking dateResources - Booked hours with actualsRecognized + Projected Revenue (CAD)Projected cost [primary loaded cost] (CAD)Actual + Projected Margin (CAD)
5/23/20165/1/2016Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20161032650000
5/23/20166/1/2016Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20161123000000
5/23/20167/1/2016Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/2016953300000
5/23/20168/1/2016Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20161301250000
5/23/20169/1/2016Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20161062500000
5/23/201610/1/2016Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20161253500000
5/23/201611/1/2016Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20161025500000
5/23/201612/1/2016Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20161092340000
5/23/20161/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
5/23/20162/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
5/23/20163/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
5/23/20164/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
5/23/20165/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
5/23/20166/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
5/23/20167/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
5/23/20168/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
5/23/20169/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
5/23/201610/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
5/23/201611/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
5/23/201612/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
5/23/20161/1/2018Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
5/23/20162/1/2018Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
5/23/20163/1/2018Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
5/23/20164/1/2018Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
5/23/20165/1/2018Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
6/23/20165/1/2016Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20161002500000
6/23/20166/1/2016Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20161022550000
6/23/20167/1/2016Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20161052450000
6/23/20168/1/2016Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20161072340000
6/23/20169/1/2016Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20161004500000
6/23/201610/1/2016Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20161025500000
6/23/201611/1/2016Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20161056500000
6/23/201612/1/2016Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20161072340000
6/23/20161/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
6/23/20162/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
6/23/20163/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
6/23/20164/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
6/23/20165/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
6/23/20166/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
6/23/20167/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
6/23/20168/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
6/23/20169/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
6/23/201610/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
6/23/201611/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
6/23/201612/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
6/23/20161/1/2018Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
6/23/20162/1/2018Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
6/23/20163/1/2018Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
6/23/20164/1/2018Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
6/23/20165/1/2018Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
7/23/20165/1/2016Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20161072600000
7/23/20166/1/2016Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20161102450000
7/23/20167/1/2016Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/2016982300000
7/23/20168/1/2016Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/2016100500000
7/23/20169/1/2016Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20161022500000
7/23/201610/1/2016Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20161023500000
7/23/201611/1/2016Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20161056000000
7/23/201612/1/2016Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20161072340000
7/23/20161/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
7/23/20162/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
7/23/20163/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
7/23/20164/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
7/23/20165/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
7/23/20166/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
7/23/20167/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
7/23/20168/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
7/23/20169/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
7/23/201610/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
7/23/201611/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
7/23/201612/1/2017Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
7/23/20161/1/2018Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
7/23/20162/1/2018Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
7/23/20163/1/2018Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
7/23/20164/1/2018Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000
7/23/20165/1/2018Test CompanyProject AClient AVAActiveBillableFirm Fixed Price12/1/20160000

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.