Forum Discussion

unais's avatar
unais
Helper V
6 years ago
Solved

Same Period Last Year Not Working With Filter

Dears, Please advise below  DAX  with Sameperiodlast year not working..   SalaryWithCC(WithoutWPS) Last Year = CALCULATE(SUM(ZFAGLFLEXA_FI_DOC[NEWHSL]) ,FILTER(ZFAGLFLEXA_FI_DOC,ZFAGLFLEXA_FI_DOC...
  • FarhanAhmed's avatar
    6 years ago

    I think best thing is to do is create 2 filters

     

    - One with your actual measures with Filter

    SalaryWithCC(WithoutWPS)  = CALCULATE(SUM(ZFAGLFLEXA_FI_DOC[NEWHSL]) ,FILTER(ZFAGLFLEXA_FI_DOC,ZFAGLFLEXA_FI_DOC[RCNTR] <> "" ),FILTER(GLMapping,GLMapping[GLGroup_Index]="3"),FILTER(ZCEPCT_PRFT_TXT,ZCEPCT_PRFT_TXT[INCGRP1]="INCGRP1") )

     

    - After that you should create Last Year Measure

     

    SalaryWithCC(WithoutWPS) Last Year = CALCULATE( SalaryWithCC(WithoutWPS), SAMEPERIODLASTYEAR (Calendar[Date]))
    
    

     

    Make sure that your calendar is marked as "Date Table"