Pivot table data reporting problem

Burrgogi

Active Member
Joined
Nov 3, 2005
Messages
495
Office Version
  1. 2010
Platform
  1. Windows
I wanted an easy way to keep track of all the games that own so I created a spreadsheet. Here is a small sample.

Excel library sample 1.png

col. A = Game Title
col. B = Library 1
col. C = Library 2
col. D = Library 3

Some games I have just on Steam, see row #2.
While some games I own on multiple services GoG, HB & Steam. See row # 8.

Instead of using column filters, I decided to create a pivot table on a separate worksheet that shows all the games I own just on Steam alone. I'm not getting the expected results. Not sure what I'm doing wrong.

Excel pivot table no good.png


I've tried various combinations such as moving the Library 1, 2, & 3 fields over to the Column Labels but it's not working.
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Start by turning your data into a proper Excel table ( = select a single cell and use the shortcut Ctrl + T ). This way your data expands when you add new rows / columns to your data.

Once you've turned your data into a table use Power Query ( Power Query is a free add-in for Excel 2010-2013 but built-in in later versions ) to unpivot your data ( select only the Title column and use "Unpivot other columns" just to make sure your table can be expanded with new columns if needed. For this you might want to delete the "Change type" -step Power Query likes to add to your query automatically. ) into a correct data structure. What you're after is a single column for game titles and a single column for your services. The Library 1 etc. doesn't seem to add any value to your data so you can remove the Attribute column you're going to get when you unpivot your data.

When you have turned your data into a proper structure you can close your Power Query. Just make sure you load your data into a connection only + check the "Add this data to the Data Model" so you can use the Power Pivot instead of the old-fashioned pivot tables:

1721276138570.png


Also, you might want to add another column for the Version of the game: I'm not familiar with games but to me it looks like Bioshock 1 is basically the same game as Bioshock 1 Remastered Version. Having another column for the different versions makes sense if you want to count both versions as a single game instead of two games as it is stated in your current data.

Another thing you might want to do is make sure you've unchecked the Enable Background Refresh from your query properties ( = right click the query name in your Queries & Connection window + click on the Properties ).

If you don't see a Power Pivot tab in your Excel ribbon right click on any of the current tabs in your ribbon and select "Customize the Ribbon" and make sure the Power Pivot is checked.

When you have your data in your Data Model you can start adding the DAX measures. I'm thinking something like Games Count ( = count of unique game titles ) and Libraries ( = number of libraries the same game is found on ):
Power Query:
Games Count:=DISTINCTCOUNT(Games[Title])

Libraries:=COUNTROWS(Games)

Make sure the Table / Column names match with the table / column names of your data. Here's what my Games table looks in Power Query:
1721278373046.png
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,107
Members
453,021
Latest member
Justyna P

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