+ Reply to Thread
Results 1 to 2 of 2

Median in Pivot table

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    07-29-2009
    Location
    Melbourne, Australia
    MS-Off Ver
    365
    Posts
    255

    Median in Pivot table

    Hi

    In attached I have a two column table. Trying to find Medians / Percentiles via a new measure in the pivot table but getting an error. (Blank values must remain in the table for other reasons)

    Not sure why / how to fix..

    Q
    Attached Files Attached Files
    Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind.

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    19,035

    Re: Median in Pivot table

    The error message for the measure states that MEDIAN does not support types string/Boolean/date.
    Looking at the data model the study scores are of the type text (string) which can not be changed in the data model.
    My suggestion of how to fix is to produce a second table (green/white) using power query, add the new table to the data model, add the MEDIAN measure and then produce the pivot table.
    The power query code is:
    let
        Source = Excel.CurrentWorkbook(){[Name="Table2"]}[Content],
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Study Score ", Int64.Type}, {"Subject Code", type text}}),
        #"Filtered Rows" = Table.SelectRows(#"Changed Type", each ([#"Study Score "] <> null))
    in
        #"Filtered Rows"
    Note that when data is updated in the original blue/white table then refresh the green/white table (and the pivot table if necessary).
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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. Replies: 2
    Last Post: 04-26-2017, 11:28 AM
  2. How can I put the median on a pivot table?
    By JAH in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-22-2005, 03:05 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