Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Get Last value previous month

Hi,   I need your help. I would like retreive the last value on previous calendar to a specific month.   My data are :   receipt line   i create this measure   Mt YTD = TOTALYTD(SUM(...
  • Anonymous's avatar
    Anonymous
    4 years ago

    amitchandak 

     

    i found the solution with this table definition and new measure 

     

    receipt Group = ADDCOLUMNS( 
                        Summarize( ReceiptLine, ReceiptLine[ITEMID],ReceiptDate[Year-month],ReceiptDate[Year])
                    ,"_Mt au PRI N-1", [Qte YTD]*[Price N-1])
    
    
    new measure
    ==>
    test = CALCULATE(max('receipt Group'[_Mt au PRI N-1]),Filter('receipt Group','receipt Group'[Year]=SELECTEDVALUE(ReceiptDate[Year]) && 'receipt Group'[Year-month]<= SELECTEDVALUE(ReceiptDate[Year-month])))