• Creating a Spacer Column in a PowerPivot PivotTable

    Mike Alexander has a great blog post on how to Add Column Spacing In A PivotTable. We can also accomplish the same thing through a PowerPivot solution, but using DAX. And in this case, DAX is even easier to use that the old method, taking one less step!

    To start, go to the PowerPivot tab and choose:
    • 2010: New Measure
    • 2013+: Calculated Field --> New Calculated Field

    The 2013 user interface is shown below:

    As you can see, I called it "Spacer", and the formula is simply =BLANK()

    From there it gets added to the PivotTable and already shows up as blank values.

    At that point, I just went to one of the fields on the worksheet that said "Spacer", and entered 5 spaces into the cell. (Unfortunately, you can't name the measure/calculated field with a only spaces in the setup, or we wouldn't even have to do that!) Why 5? Well, it controls the width of the column when it's refreshed!

    End result (with the blank column selected so you can see it):
    This article was originally published in blog: Creating a Spacer Column in a PowerPivot PivotTable started by Ken Puls

     

    I'm afraid that you must be logged in to comment or leave a testimonial. I wish it could be otherwise, but I'm trying to keep my site spam free for everyone's benefit. If you don't yet have an account it's completely free to sign up, and a very quick process. Simply click here to Register. Not only can you post a comment here, but it gives you full access to posts questions in our forum as well!

     

    If you already have an account, and just haven't logged in yet, what are you waiting for? Login Now!

  • MVP Logo
  • Recent Forum Posts

    p45cal

    Please help!

    Aagh. Beaten to it!
    Power Query solution at cell H10.
    Update the data in the table at cell A1 then right-click the result table and choose...

    p45cal Today, 11:27 AM Go to last post
    alansidman

    Please help!

    A Power Query solution:

    Code:
    let
        Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
        #"Unpivoted Columns"
    ...

    alansidman Today, 10:39 AM Go to last post
    cprop76

    Thanks, sample attached!

    Thanks, sorry for the VERY late reply, I've been out of the office all week. I've attached a sample which hopefully makes sense! The left hand side is...

    cprop76 Today, 03:41 AM Go to last post
    p45cal

    Check cell format is Date ignore blank cells

    try:

    Click on the picture to get a clearer view.

    Oops, fotrgot the code:

    Code:
    Private Sub DateFormat()
    Dim myRange As Range
    ...

    p45cal Yesterday, 03:01 PM Go to last post
    RET

    Check cell format is Date ignore blank cells

    Try this

    HTML Code:
    Private Sub DateFormat()
       Dim myRange As Range
       Dim Celda As Range
       
       Set myRange = Range("B2:B14")
    ...

    RET 2020-11-29, 09:24 PM Go to last post