+ Reply to Thread
Results 1 to 4 of 4

DAX - IF Statement Help

  1. #1
    Registered User
    Join Date
    08-30-2016
    Location
    Edmonton, Canada
    MS-Off Ver
    2016 64b
    Posts
    92

    DAX - IF Statement Help

    I have a simple IF Statement in DAX: =(IF('X'>0,0,1)) - this works

    What I want is to have it do this: =(IF('X'>0,"R","E")) - this does not work (Error)

    I keep getting errors because of the text values in this clause; help is appreciated to resolve this.

    Thank you.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: DAX - IF Statement Help

    Hello happyddays886,

    Just so everyone knows, DAX is short for Data Analysis Expressons.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: DAX - IF Statement Help

    Hi,

    Where are you writing this DAX- PowerPivot? If so, which build? Also, what is 'X' meant to be? In my 2010 PP add-in, a simple =IF([Field name]>0,"Yes","No") works fine.
    Last edited by xlnitwit; 07-27-2017 at 06:43 AM.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  4. #4
    Registered User
    Join Date
    08-30-2016
    Location
    Edmonton, Canada
    MS-Off Ver
    2016 64b
    Posts
    92

    Re: DAX - IF Statement Help

    Doesn't work - see attached images.

    Capture.PNG
    Capture2.PNG

+ 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: 07-09-2015, 04:25 PM
  2. [SOLVED] If statement to select data - nested statement - assistance
    By petitesouris in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-29-2015, 09:55 PM
  3. compile error expected line number statement end statement
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-18-2014, 10:12 AM
  4. VBA Compile Error : line number or label or statement or end of statement
    By excellearner121 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2013, 06:41 PM
  5. Replies: 4
    Last Post: 06-01-2012, 10:05 AM
  6. Replies: 4
    Last Post: 05-16-2012, 05:33 PM
  7. [SOLVED] Utilize a Select Case Statement in Target Intersect Statement
    By max57 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-29-2009, 08:55 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