Pivot Tables Help

caaronh85

New Member
Joined
May 15, 2021
Messages
18
Office Version
  1. 365
Platform
  1. Windows
Hello everyone, I'm looking for help on how to get specific data into a pivot table and I can't seem to get it right. Basically, when a date/s are selected the specific repairs and their corresponding quantities are displayed. The ID and specialist columns aren't necessary. I'd also like to be able to group the repairs and quantities so for each date selected it shows the totals of all 3 repairs for each date, ie; if 2 weeks of dates were selected on the pivot table, it would show all asic, thermal reflows, unrepairable, etc for those specific dates.
 

Attachments

  • PIVOTT.JPG
    PIVOTT.JPG
    111 KB · Views: 17

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
What is the significance of having three different columns for repair + quantity 1 through 3? Does that just mean you can have up to three repairs for each ID?

Generally it makes visualization much easier if you have one column for each measure. In this case you would have one column for repair and one column for quantity - ID Ref 75 would then take up two lines in your table, for example. If it would be important to filter out repair #2 vs repair #1, you can add a column called repair # (if you need to). Give that a go and let us know how that turns out.
 
Upvote 0
What is the significance of having three different columns for repair + quantity 1 through 3? Does that just mean you can have up to three repairs for each ID?

Generally it makes visualization much easier if you have one column for each measure. In this case you would have one column for repair and one column for quantity - ID Ref 75 would then take up two lines in your table, for example. If it would be important to filter out repair #2 vs repair #1, you can add a column called repair # (if you need to). Give that a go and let us know how that turns out.
Yes, an ID might, and usually does, have more than one repair. When I add more than 1 ‘Repair #’ to the table, it messes the whole table up. I might have to count them all and then add it but idk.
 
Upvote 0
we cannot work on pictures, please provide minisheet or file link so we cancheck it ourselves.
also why don't you follow columnar data base solutions?
 
Upvote 0
we cannot work on pictures, please provide minisheet or file link so we cancheck it ourselves.
also why don't you follow columnar data base solutions?
Master Repair Metrics.xlsx
ABCDEFGHI
1IDSpecialistRepair 1Quantity 1Repair 2Quantity 2Repair 3Quantity 3Date
2Ref 55DakotaThermal Reflow16/2/2021
3Ref 74JonathanUnrepairable16/2/2021
4Ref 75JonathanThermal Reflow1ASIC16/2/2021
5Ref 102DakotaThermal Reflow1ASIC16/2/2021
6Ref 204DakotaThermal Reflow16/2/2021
7Ref 203DakotaThermal Reflow16/2/2021
8Ref 202DakotaThermal Reflow16/3/2021
9Ref 205JonathanChip Reflow16/3/2021
10Ref 210JonathanUnrepairable16/3/2021
11Ref 81DakotaUnrepairable16/3/2021
12Ref 215DakotaUnrepairable16/3/2021
13Ref 208DakotaUnrepairable16/3/2021
14Ref 200JonathanThermal Reflow16/3/2021
15Ref 221DakotaUnrepairable16/3/2021
16Ref 220DakotaUnrepairable16/3/2021
17Ref 219JonathanUnrepairable16/3/2021
18Ref 217DakotaUnrepairable16/3/2021
19Ref 209DakotaThermal Reflow1ASIC36/3/2021
20Ref 86DakotaUnrepairable16/3/2021
21Ref 63DakotaUnrepairable16/3/2021
HB Repairs
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:A283Cell ValueduplicatestextNO
Cells with Data Validation
CellAllowCriteria
A2:A21List=$A$2:$A$1048576
 
Upvote 0
it would be hell of a better way to follow columnar database solution
instead of having Repair #1 as a header it should be a column to which u specify repair #1 or #2 or #3
the for quantity, this will be way simpler to accomplish in pivot table

here try this PT:DataModel.xlsx

DataModel.xlsx
ABCDEFGHIJKLM
1IDSpecialistRepair 1Quantity 1Repair 2Quantity 2Repair 3Quantity 3DateIDSum of Quantity
2Ref 55DakotaThermal Reflow106.02.2021Ref 1022
3Ref 74JonathanUnrepairable106.02.2021Ref 2001
4Ref 75JonathanThermal Reflow1ASIC106.02.2021Ref 2021
5Ref 102DakotaThermal Reflow1ASIC106.02.2021Ref 2031
6Ref 204DakotaThermal Reflow106.02.2021Ref 2041
7Ref 203DakotaThermal Reflow106.02.2021Ref 2051
8Ref 202DakotaThermal Reflow106.03.2021Ref 2081
9Ref 205JonathanChip Reflow106.03.2021Ref 2094
10Ref 210JonathanUnrepairable106.03.2021Ref 2101
11Ref 81DakotaUnrepairable106.03.2021Ref 2151
12Ref 215DakotaUnrepairable106.03.2021Ref 2171
13Ref 208DakotaUnrepairable106.03.2021Ref 2191
14Ref 200JonathanThermal Reflow106.03.2021Ref 2201
15Ref 221DakotaUnrepairable106.03.2021Ref 2211
16Ref 220DakotaUnrepairable106.03.2021Ref 551
17Ref 219JonathanUnrepairable106.03.2021Ref 631
18Ref 217DakotaUnrepairable106.03.2021Ref 741
19Ref 209DakotaThermal Reflow1ASIC306.03.2021Ref 752
20Ref 86DakotaUnrepairable106.03.2021Ref 811
21Ref 63DakotaUnrepairable106.03.2021Ref 861
22Grand Total25
23
Sheet1


PQ Code:
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"ID", "Specialist","Date"}, "Attribute", "Value"),
    #"Added Conditional Column" = Table.AddColumn(#"Unpivoted Other Columns", "Custom", each if Text.Contains([Attribute], "Repair") then [Value] else null),
    #"Added Conditional Column1" = Table.AddColumn(#"Added Conditional Column", "Custom.1", each if Text.Contains([Attribute], "Quantity") then [Value] else null),
    #"Filled Up" = Table.FillUp(#"Added Conditional Column1",{"Custom.1"}),
    #"Renamed Columns" = Table.RenameColumns(#"Filled Up",{{"Custom", "Repair"}, {"Custom.1", "Quantity"}}),
    #"Filtered Rows" = Table.SelectRows(#"Renamed Columns", each ([Repair] <> null)),
    #"Removed Other Columns" = Table.SelectColumns(#"Filtered Rows",{"ID", "Specialist", "Date", "Repair", "Quantity"}),
    #"Changed Type" = Table.TransformColumnTypes(#"Removed Other Columns",{{"Date", type date}, {"ID", type text}, {"Specialist", type text}, {"Repair", type text}, {"Quantity", Int64.Type}})
in
    #"Changed Type"

Result table is loaded str8 to data model.
 
Last edited:
Upvote 0
Solution
I
it would be hell of a better way to follow columnar database solution
instead of having Repair #1 as a header it should be a column to which u specify repair #1 or #2 or #3
the for quantity, this will be way simpler to accomplish in pivot table
I don't understand what you mean by 'columnar database solution'. My overall goal is to be able to select a date, or range of dates, and show all the specific repairs for the dates selected. The ID and specialist column isn't important to add. If you know a better way to accomplish this, I'm open to it.
 
Upvote 0
you can download that file and see what I have done.
you also have office 365 which means if PT is not solution for you then you might want do sth like I proposed here:
it does filtering data based on multiple criteria.
this also would be best if done on properly set up table.
 
Upvote 0
Th
it would be hell of a better way to follow columnar database solution
instead of having Repair #1 as a header it should be a column to which u specify repair #1 or #2 or #3
the for quantity, this will be way simpler to accomplish in pivot table

here try this PT:DataModel.xlsx

DataModel.xlsx
ABCDEFGHIJKLM
1IDSpecialistRepair 1Quantity 1Repair 2Quantity 2Repair 3Quantity 3DateIDSum of Quantity
2Ref 55DakotaThermal Reflow106.02.2021Ref 1022
3Ref 74JonathanUnrepairable106.02.2021Ref 2001
4Ref 75JonathanThermal Reflow1ASIC106.02.2021Ref 2021
5Ref 102DakotaThermal Reflow1ASIC106.02.2021Ref 2031
6Ref 204DakotaThermal Reflow106.02.2021Ref 2041
7Ref 203DakotaThermal Reflow106.02.2021Ref 2051
8Ref 202DakotaThermal Reflow106.03.2021Ref 2081
9Ref 205JonathanChip Reflow106.03.2021Ref 2094
10Ref 210JonathanUnrepairable106.03.2021Ref 2101
11Ref 81DakotaUnrepairable106.03.2021Ref 2151
12Ref 215DakotaUnrepairable106.03.2021Ref 2171
13Ref 208DakotaUnrepairable106.03.2021Ref 2191
14Ref 200JonathanThermal Reflow106.03.2021Ref 2201
15Ref 221DakotaUnrepairable106.03.2021Ref 2211
16Ref 220DakotaUnrepairable106.03.2021Ref 551
17Ref 219JonathanUnrepairable106.03.2021Ref 631
18Ref 217DakotaUnrepairable106.03.2021Ref 741
19Ref 209DakotaThermal Reflow1ASIC306.03.2021Ref 752
20Ref 86DakotaUnrepairable106.03.2021Ref 811
21Ref 63DakotaUnrepairable106.03.2021Ref 861
22Grand Total25
23
Sheet1


PQ Code:
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"ID", "Specialist","Date"}, "Attribute", "Value"),
    #"Added Conditional Column" = Table.AddColumn(#"Unpivoted Other Columns", "Custom", each if Text.Contains([Attribute], "Repair") then [Value] else null),
    #"Added Conditional Column1" = Table.AddColumn(#"Added Conditional Column", "Custom.1", each if Text.Contains([Attribute], "Quantity") then [Value] else null),
    #"Filled Up" = Table.FillUp(#"Added Conditional Column1",{"Custom.1"}),
    #"Renamed Columns" = Table.RenameColumns(#"Filled Up",{{"Custom", "Repair"}, {"Custom.1", "Quantity"}}),
    #"Filtered Rows" = Table.SelectRows(#"Renamed Columns", each ([Repair] <> null)),
    #"Removed Other Columns" = Table.SelectColumns(#"Filtered Rows",{"ID", "Specialist", "Date", "Repair", "Quantity"}),
    #"Changed Type" = Table.TransformColumnTypes(#"Removed Other Columns",{{"Date", type date}, {"ID", type text}, {"Specialist", type text}, {"Repair", type text}, {"Quantity", Int64.Type}})
in
    #"Changed Type"

Result table is loaded str8 to data model.
This works but it doesn't seem to update when new data is added?
 
Upvote 0

Forum statistics

Threads
1,215,261
Messages
6,123,932
Members
449,134
Latest member
NickWBA

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top