+ Reply to Thread
Results 1 to 4 of 4

Calculated Field in Pivot from Data Model

  1. #1
    Registered User
    Join Date
    12-14-2018
    Location
    Staffordshire, England
    MS-Off Ver
    365
    Posts
    60

    Calculated Field in Pivot from Data Model

    Hi All,

    I just started to work with a Data Model for the first time and have been trying to replicate a calculated field I had in a previous version of my workbook. This was a simple divide calculation to obtain a % of profit from the profit and revenue.

    I have added a column to my data model using this formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    However when adding this field to the pivot table I can not get it to show the correct Gross Profit percentage for each row on my pivot table. Below is a few examples of what I am seeing:

    Revenue Gross Profit GP%
    £482,429 £100,696 -3.38%
    £77,906 £18,277 -102.25%
    £676 -£322 -60.45%

    Please can anyone advise how I can accordingly get this to display the correct figure and so that a GP% of 100696 / 482429 will show as 20.87% for example?

    Thanks,

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Calculated Field in Pivot from Data Model

    Can you upload sample workbook? Without looking at how your data model is structured. It is bit hard to give you guidance on DAX.

    As DAX calculations are highly dependent on calculation context (filter, pivot table row/column context etc).

    My guess is that calculation is done on row basis on Calculated Column, then results are added together.
    Rather than on aggregated result of respective columns in current context.

    Try using DAX measure, instead of calculated column.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Registered User
    Join Date
    12-14-2018
    Location
    Staffordshire, England
    MS-Off Ver
    365
    Posts
    60

    Re: Calculated Field in Pivot from Data Model

    Thanks for your advice - I've done that and its solved the problem!!

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Calculated Field in Pivot from Data Model

    You are welcome

+ 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. Calculated field greyed out after adding data to the data model
    By paula10 in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 02-20-2017, 09:12 AM
  2. Replies: 0
    Last Post: 08-15-2016, 02:07 PM
  3. adding a calculated field to power pivot data model
    By stephme55 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 01-26-2016, 07:13 PM
  4. Running Count in PowerPivot
    By efarkouh in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 10-07-2014, 10:33 AM
  5. Calculated Field When Using Data Model
    By efarkouh in forum Excel General
    Replies: 0
    Last Post: 10-06-2014, 03:57 PM
  6. Replies: 0
    Last Post: 06-26-2012, 09:06 PM
  7. [SOLVED] pivot table formulas for calculated field or calculated item
    By Vicky in forum Excel General
    Replies: 3
    Last Post: 06-06-2006, 12:10 AM

Tags for this Thread

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