+ Reply to Thread
Results 1 to 6 of 6

DAX power Pivot or Calculated Column return previous row nonnumeric value

  1. #1
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    610

    DAX power Pivot or Calculated Column return previous row nonnumeric value

    Hi,

    I'm trying to get nonnumeric value from the previous row, I've use MAXX this for a numeric vlaue
    I've included workbook showing what I'd like to get back using lookupvalue.
    Meassure ;
    Please Login or Register  to view this content.
    I'm stuck as to how to get eg "A" , [[Tunits] is sum(Tablle1[Units]) ,

    So far I've got , but can't use max to bring back a non number;
    Please Login or Register  to view this content.

    I tried uisng a measure ; MAX(Table1 [Item]) , but this gives only one answer in the totals;

    Any suggestions, (helpful)

    Richard
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: DAX power Pivot or Calculated Column return previous row nonnumeric value

    Try adding the following measure:
    Please Login or Register  to view this content.
    Then replace fx Copy of Previous with fx Previous in the Values area.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  3. #3
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    610

    Re: DAX power Pivot or Calculated Column return previous row nonnumeric value

    Hi,
    thanks, not quite sure if this is what you meant, but it seems to work,
    First I just used the 'Lookup column so ;
    Please Login or Register  to view this content.
    but as I really wanted t avoid a calculated column tried using Lookupvalue inside concatenatex

    In One:=
    Please Login or Register  to view this content.
    Which also works. Now to get the same result but without an index and just a non consecutive date column to work off , Hmmm.


    Richard

  4. #4
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,908

    Re: DAX power Pivot or Calculated Column return previous row nonnumeric value

    Using MAXX should allow that - something like:

    Please Login or Register  to view this content.
    Rory

  5. #5
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    610

    Re: DAX power Pivot or Calculated Column return previous row nonnumeric value

    Thanks, I hadn't actually got around to having a go, it wasn't until the first response that I found you can use Lookupvalue in a measure, I'd only used it in columns, another way to solve this in power bi might be to use the new OFFSET function, but I've not really had a go of using it yet and can't imagine it works in power pivot.

    Richard.

  6. #6
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    610

    Re: DAX power Pivot or Calculated Column return previous row nonnumeric value

    Just to add my reason for wanting this is that, and you are probably aware, but if you use the item
    with a grow measure (Sale - Previous) / Previous, it also filters by the item only show a result where there are consecutive item.
    but if you put in the previous item, it all makes sense.

    I've uploaded examples of both.

    Richard
    Attached Files Attached Files

+ 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] Power pivot Calculated column skipping top 'row' .
    By Dicken in forum Office 365
    Replies: 5
    Last Post: 07-24-2022, 09:35 AM
  2. [SOLVED] Adding calculated yield column to power pivot table
    By marks9172 in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 01-08-2022, 06:02 PM
  3. Replies: 1
    Last Post: 01-09-2021, 06:14 AM
  4. Replies: 3
    Last Post: 08-10-2020, 11:38 AM
  5. Add Calculated Field from Power Pivot
    By kyingh in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 04-11-2019, 01:52 AM
  6. [SOLVED] Power pivot or pivot table for connecting data and creating calculated fields
    By jaryszek in forum Excel Charting & Pivots
    Replies: 9
    Last Post: 02-06-2019, 08:31 AM
  7. Power Pivot - calculated fields
    By Tank13 in forum Excel General
    Replies: 1
    Last Post: 08-27-2014, 12:59 PM

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