Results 1 to 2 of 2

Thread: Dax Expression with Variable v Hardcoded

  1. #1

    Dax Expression with Variable v Hardcoded



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Hi All

    i am having difficulty understanding why the following does not work. i have read many articles on variables and do not see why this would makes a difference.


    this formula gives me 8 = MONTH(LASTDATE(OrderLines[OrderDate]))

    if i put this formula below instead of the hardcoded 8 the measure does not work. where it works ok with hardcoded 8?

    CumulativeExVAT =
    var cmonth = 8
    var cyear = 2016

    RETURN

    CALCULATE (
    SUM ( OrderLines[ExVatValue] )
    , FILTER (
    ALL ( DimDates ),
    DimDates[Day] <= MAX ( DimDates[Day] )
    && DimDates[Month Number] = cmonth
    && DimDates[Year] = cyear
    )
    )


    thanks for any advice
    Mike

  2. #2
    this is sorted now

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •