Forum Discussion

Velvetine27's avatar
Velvetine27
Icon for Helper I rankHelper I
3 years ago
Solved

Product Aging Life

Hi guys, I have two tables which look like this : Table A : SKU PostingDate QtyMovement Batch 101 13/1/2022 1000 ABC123 101 15/1/2022 -50 ABC123 101 20/1/2022 -30 ABC12...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Velvetine27 ,

    Measure = var aging180 = CALCULATE(MAX('DATE'[Date]) - 180)
    return 
    CALCULATE(SUM('Table A'[QtyMovement]), FILTER('Table A', 'Table A'[PostingDate]<aging180))

    The aging180 returns a  half a year before the selected date. When you select 2022/1/8, it would return 2021/7/12. And the "CALCULATE(SUM('Table A'[QtyMovement]), FILTER('Table A', 'Table A'[PostingDate]<aging180))"returns QtyMovement of Table A and PostingDate is earlier than 2021/7/12 .

     

    In the table A, there is no date earlier than 2021/7/12. So it returns blank. You can change the measure.

    Measure = var aging180 = CALCULATE(MAX('DATE'[Date]) - 180)
    return 
    CALCULATE(SUM('Table A'[QtyMovement]), FILTER('Table A', 'Table A'[PostingDate]>aging180))

    How to Get Your Question Answered Quickly 

     

    If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

     

    Best Regards
    Community Support Team _ Polly

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