Forum Discussion

sarath_chandra's avatar
sarath_chandra
Helper III
3 years ago
Solved

DAX help

I have charge date (which is first day of each month) as column , and month wise column (first day of each month ) and stocks column.   i need if i select one month in date slicer (charge date) for...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi sarath_chandra 

     You can create two measures:

    Actual_ = IF(SELECTEDVALUE('Table (3)'[month-wise])<SELECTEDVALUE('Table (3)'[charge_date]),SUM([stocks]),0)
    
    Future_ = IF(SELECTEDVALUE('Table (3)'[month-wise])>=SELECTEDVALUE('Table (3)'[charge_date]),SUM([stocks]),SUMX(FILTER(ALL('Table (3)'),'Table (3)'[month-wise]=SELECTEDVALUE('Table (3)'[month-wise])&&'Table (3)'[charge_date]=SELECTEDVALUE('Table (3)'[charge_date])-1),[stocks]))

     

     

     

     

    Best Regards,

    Yolo Zhu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.