Results 1 to 2 of 2

Thread: Calculate Difference Between Columns in Pivot Table

  1. #1
    Seeker user0X's Avatar
    Join Date
    May 2018
    Posts
    13
    Articles
    0
    Excel Version
    2019

    Calculate Difference Between Columns in Pivot Table



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Is there a method/formula to calculate the difference between two columns generated from a single row for a pivot table?

    Click image for larger version. 

Name:	Difference Between Rows.JPG 
Views:	54 
Size:	65.3 KB 
ID:	10263
    Attached Files Attached Files

  2. #2
    Conjurer alansidman's Avatar
    Join Date
    Oct 2018
    Location
    Steamboat Springs
    Posts
    343
    Articles
    0
    Excel Version
    O365
    Pivot your data in Power Query and add a new column

    Code:
    let
        Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"Description", type text}, {"Amt", Int64.Type}, {"Type", type text}}),
        #"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"Date"}),
        #"Pivoted Column" = Table.Pivot(#"Removed Columns", List.Distinct(#"Removed Columns"[Type]), "Type", "Amt", List.Sum),
        #"Added Custom" = Table.AddColumn(#"Pivoted Column", "Claim -CR", each [Claim]-[Cr])
    in
        #"Added Custom"
    Attached Files Attached Files

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •