+ Reply to Thread
Results 1 to 5 of 5

DAX measure use Month Number as value to return true / false

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

    DAX measure use Month Number as value to return true / false

    Hi, I wanted to use the monht nuumber as a true / false criteria in a measure, my starting point was

    Please Login or Register  to view this content.
    This gives a count of 1 to 12 in a pivot and works perfectly well with say [TotalSales] / [ALLMONTHS] ,

    but if if try and use it with an IF ;
    Please Login or Register  to view this content.
    I get an error, I sort of get why this does not work but is there another ( hopefully simpler) way to get a true / false from the month number,
    ive attached workbook to give some context.

    Richard.
    Attached Files Attached Files

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

    Re: DAX measure use Month Number as value to return true / false

    ALLMONTHS is text so you need to wrap it in VALUE to compare to a number:

    Please Login or Register  to view this content.
    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
    777

    Re: DAX measure use Month Number as value to return true / false

    Thanks, I thought it was something more complicated.

    Richard.

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

    Re: DAX measure use Month Number as value to return true / false

    Just one question, I used in as a Denominator in TotalDivide:=
    Please Login or Register  to view this content.
    this works, so Allmonths here must be a number?

    Richard.

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

    Re: DAX measure use Month Number as value to return true / false

    Having now looked up MS Docs;

    You do not generally need to use the VALUE function in a formula because the engine implicitly converts text to numbers as necessary.

+ 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: 3
    Last Post: 08-16-2018, 06:07 AM
  2. [SOLVED] IF logical test pass return with 1st LOOKUP if true, if false then return with 2nd VLOOKUP
    By powerzasty in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-21-2017, 03:55 PM
  3. [SOLVED] How to look up data based on unique number in one colum to return if true of false
    By foxyspook in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-04-2016, 05:30 AM
  4. Return True or False if date range falls within current month
    By kieran614 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-17-2013, 12:02 PM
  5. Return #VALUE! as True or False
    By BlastRanger in forum Excel General
    Replies: 3
    Last Post: 09-08-2010, 03:14 AM
  6. Replies: 3
    Last Post: 07-15-2006, 05:20 AM
  7. Function to return True/False if all are validated as True by ISNU
    By Tetsuya Oguma in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-15-2006, 06:30 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