Forum Discussion

glennkobes's avatar
glennkobes
New Member
5 years ago
Solved

repost: Wine Inventory

Hi, This is a repost as I have not yet found a solution. Orignal post.   I also have the link to the file (here). My main issue is that I have a measure to get the latest date for which there is a "...
  • themistoklis's avatar
    5 years ago

    glennkobes 

     

    Make sure you assign the date in 'Last Set Date In Context' field to a variable.

     

    Then add the variable to the measure:

     

     

    Measure =
    VAR _Last_Set_Date_In_Context = MAX(WineLog[Bottles])
    
    RETURN
    SUMX(
    WineList,
    CALCULATE(
    sum(WineLog[Bottles])*-1,
    WineLogtt[Transaction Type] = "Take",
    filter( 'Calendar','Calendar'[date] >= _Last_Set_Date_In_Context)))