+ Reply to Thread
Results 1 to 10 of 10

How to filter out blanks from column in Pivot Table (Data Model)

  1. #1
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Question How to filter out blanks from column in Pivot Table (Data Model)

    Hello all,

    I can't seem to figure out how to remove rows from a pivot table that was built from a data model.
    I want to remove the rows where "Sum of Sales" is blank.

    I tried selecting one of the SKU Descriptions in the pivot > Filter > Value Filters > Sum of Sales greater than 0, but that does not remove the blanks.

    Please see attached.

    Thank you in advance!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: How to filter out blanks from column in Pivot Table (Data Model)

    You have to use only table4 with the extra column
    Attached Files Attached Files
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  3. #3
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: How to filter out blanks from column in Pivot Table (Data Model)

    New Measure: Sum_Inventory

    =if(sum(Sales[Sales]),sum(Inventory[Inventory]))
    Attached Files Attached Files

  4. #4
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: How to filter out blanks from column in Pivot Table (Data Model)

    Thanks for this! We're almost there.
    Is there a way to get the subtotals to sum correctly when the pivot table is collapsed?
    Last edited by AliGW; 01-13-2022 at 12:32 PM. Reason: PLEASE don't quote unnecessarily!

  5. #5
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: How to filter out blanks from column in Pivot Table (Data Model)

    Quote Originally Posted by popipipo View Post
    You have to use only table4 with the extra column
    Thank you for the reply but bringing inventory into the sales table like that will not work for my applications.
    My apologies for not providing a better example that shows this.
    I have other columns that make the Store and SKU columns duplicated so bringing Inventory into the sales table would result in the pivot table showing higher Inventory than there actually is.

  6. #6
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: How to filter out blanks from column in Pivot Table (Data Model)

    Please try

    =SUMX(ADDCOLUMNS(Sales,"Inv",CALCULATE(sum(Inventory[Inventory]))),[Inv])
    Attached Files Attached Files

  7. #7
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: How to filter out blanks from column in Pivot Table (Data Model)

    You sir are a legend.

    Seriously, I can't thank you enough!

    I tried to give you a rep but it says that I have to spread some out before I can give you more...

    I have to check to make sure that the Inventory numbers are not being duplicated but will report back with a more representative sample if they are.
    Last edited by 63falcondude; 01-13-2022 at 12:38 PM.

  8. #8
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: How to filter out blanks from column in Pivot Table (Data Model)

    Sorry about that! Here is a more representative sample.

    Since I have additional columns in my sales data, the inventory was being counted multiple times in the pivot.
    I updated the sales data sample to show this.

    Please see column O for what column N should show.
    Attached Files Attached Files

  9. #9
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: How to filter out blanks from column in Pivot Table (Data Model)

    Try

    =SUMX(GROUPBY(ADDCOLUMNS(Sales,"Inv",CALCULATE(sum(Inventory[Inventory]))),[Store],[SKU],[Inv]),[Inv])
    Attached Files Attached Files

  10. #10
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: How to filter out blanks from column in Pivot Table (Data Model)

    That did it!

    I put it into my actual report and it worked flawlessly.

    Thank you so much (again). I wish I could rep ya...

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Pivot Table Slicer Field names (Data model vs Non Data Model)
    By NewYears1978 in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 11-02-2021, 10:52 AM
  2. Replies: 0
    Last Post: 03-22-2020, 10:58 PM
  3. Replies: 3
    Last Post: 07-12-2019, 06:17 AM
  4. Filter primary pivottable Data Model with parameters from another table
    By George_1990 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-29-2017, 11:01 AM
  5. VBA filter Pivot Table basen on Data Model
    By zico8 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-04-2017, 04:31 AM
  6. Creating a Pivot Table from Power Pivot Data Model?
    By nobodyukno in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-17-2017, 12:02 PM
  7. Selecting Column Data in Pivot Table (from Data model)
    By derickz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-14-2016, 11:35 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1