Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Track Expiration Dates

Hello everyone, 

 

I got these 3 columns, I need your help in calculating the product´s usefull life until today (every actual day), and tracking with a mueasure  of how  many products are over 80% of usefull life, and under 50%

I calculated this columns, but it seems that doesn´t work with visualizations, thats why I need measures. 

Actual_Date = TODAY ()

Usefull_life_today =Table1 [expiration date] -  Table1 [Actual_Date]

Total Usefull life = Table1 [ production life] - Table1 [expiration date]

% usefull life =Table1 [ Usefull_life_today]/ Table1 [Total Usefull life]

 

The result may be 

over 80%  50 items

under 50%  34 items

 

I accept any suggestions

 

Thanks

  • Hi Anonymous,

    To get the no of values below 50% and above 80%, you can use the following 2 measures

     

    Less than 50% Usefullife = IF(ISBLANK(CALCULATE(COUNT('Item expiry'[% usefull life]),'Item expiry'[% usefull life]<0.5))=TRUE(),0,CALCULATE(COUNT('Item expiry'[% usefull life]),'Item expiry'[% usefull life]<0.5))
    Greater than 80% Usefullife = IF(ISBLANK(CALCULATE(COUNT('Item expiry'[% usefull life]),'Item expiry'[% usefull life]>0.8)) =TRUE() ,0,CALCULATE(COUNT('Item expiry'[% usefull life]),'Item expiry'[% usefull life]>0.8))

    The Below screenshot shows the Available life, Total Life, Useful life % and the measure values

     

     

    Hope this helps!!!

1 Reply

  • Hi Anonymous,

    To get the no of values below 50% and above 80%, you can use the following 2 measures

     

    Less than 50% Usefullife = IF(ISBLANK(CALCULATE(COUNT('Item expiry'[% usefull life]),'Item expiry'[% usefull life]<0.5))=TRUE(),0,CALCULATE(COUNT('Item expiry'[% usefull life]),'Item expiry'[% usefull life]<0.5))
    Greater than 80% Usefullife = IF(ISBLANK(CALCULATE(COUNT('Item expiry'[% usefull life]),'Item expiry'[% usefull life]>0.8)) =TRUE() ,0,CALCULATE(COUNT('Item expiry'[% usefull life]),'Item expiry'[% usefull life]>0.8))

    The Below screenshot shows the Available life, Total Life, Useful life % and the measure values

     

     

    Hope this helps!!!