+ Reply to Thread
Results 1 to 5 of 5

DAX measure to show text when true

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

    DAX measure to show text when true

    Hi,

    I have a two column table from which I have a pivot, I have dropped Name into rows and Item into column and then Item again into values
    which I have formatted as custom; "text"; "";"";"" , which give the result wanted but I would like a DAX measure to do the same;

    I have tried

    Please Login or Register  to view this content.
    , which give the items as text when used in pivot table , but then a second measure ;

    Please Login or Register  to view this content.
    Which works but this seems a long way round having two measures so my question is is there a better way to achieve this?

    I have attached book with both versions and source, which was first loaded to p query.

    Richard.
    Attached Files Attached Files
    Last edited by Dicken; 09-27-2023 at 10:35 AM.

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,966

    Re: DAX measure to show text when true

    There are lots of ways you could do it. You could just use:

    ="Item"
    Everyone who confuses correlation and causation ends up dead.

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

    Re: DAX measure to show text when true

    Thanks, yes that is a very straight forward way, I do have a question, happy to be pointed to blog or post on subject,
    why don't I get a value everywhere?

    so if I just had a names column each name would get 'text whatever', and the same for if i just had a column,
    so why do they filter rather than just getting the text value everywhere,
    BTW, I've seen some very long formulas on stack while trying to find an answer.

    will leave open for a while see if I get any different answers.

    Richard.

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,966

    Re: DAX measure to show text when true

    For the same reason that you don’t get 0 in all the blank cells in your first pivot. There is no data in the context of those cells so they return blank.

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

    Re: DAX measure to show text when true

    Thanks,

    RD

+ 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. Measure not show correct with Filter pass trough datamodel
    By hansolu in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 03-14-2022, 07:53 AM
  2. [SOLVED] Pivot Table Created Measure won't show up sometimes
    By NewYears1978 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 10-18-2021, 02:44 PM
  3. Only show text cooresponding to true values using a checkbox
    By Prill in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-28-2020, 09:28 PM
  4. Replies: 5
    Last Post: 11-25-2019, 03:46 AM
  5. Pivot Table: Grand Total different measure from Column measure
    By chinneywow in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 08-07-2019, 06:22 AM
  6. [SOLVED] Power Pivot Measure so I can put a text field in If condition is not true
    By rv02 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 01-06-2016, 08:59 AM
  7. If statement, TRUE , FALSE => If true show picture 1 else show picture 2
    By uaeXuae in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-07-2007, 11:29 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