Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply

Calculating a warehouse items that doesn't move for more than 10 years

Hi Community friends,

Good day.

 

I have a data for a warehouse which contains a lot of items ( commodity codes ), for each item there is a column for the [ on hand Quantity ] and the [ last issue date ] and other columns.

 

I want to know how many items that do not move ( have not been issued ) for mor than 10 Years ? and i would like to know summation of the related quantities.

 

I appreciate if someone helps.

Regards.

 

1 ACCEPTED SOLUTION

Hi @freevission2019 
Thank you for the explanation. Try this:

Countrows Measure = 
VAR _tenYears =
    TODAY () - 10 * 365.25
VAR _count =
    COUNTROWS ( FILTER ( myTable, myTable[Plant Last Issue Dt] < _tenYears ) )
RETURN
    _count

 My table is called myTable.  (All dates in my picture may not match exactly but the years are correct.) 

Sum On Hand =
VAR _tenYears =
    TODAY () - 10 * 365.25
VAR _calc =
    SUMX (
        FILTER ( myTable, myTable[Plant Last Issue Dt] < _tenYears ),
        myTable[On Hand Quantity]
    )
RETURN
    _calc

 

warehouse1.PNG

 

 
Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel







Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

9 REPLIES 9
Nathaniel_C
Super User
Super User

Hi @freevission2019 ,
You will need to give us more information to work on.

Please read this post to get your question answered more quickly:

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks a lot Nathaniel for your reply.

I really thought that the information that I provided was enough 😞

 

I am reading the above mentioned post, and I will provide more info.

 

Regards.

 

Hi,

This is a snapshot from my data, I want to know how many ( rows ) that their [ Plant Last Issue Dt ] was since more than 10 years.

 

I hope this information is suffiecient to get answers.

 

Best Regards

 

 

snapshot.png

Hi @freevission2019 ,
So this is a start, thank you.
Please give us what the expected outcome will be for this snapshot. How do we know how much has been there for 10 years?
Also better than a picture, is to copy and paste, so we can copy and paste into Power BI.

Thanks,

Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi @Nathaniel_C ,

Thanks for your interest and reply.

This data is the actual data from our inventory ( spare parts for maintenance ) . Each row contains the material code ( 9 digits ), Description, unit, Division, Created On, material type, PLANT LAST DATE, ON HAND QUANTITY and ON HAND VALUE.

 

Some materials have not been issued ( withdrawn ) for long time. we are charged a lot because of these non moving materials. The coulomn No. 8 ( Plant Last Issue Dt ) shows the last transaction's date for each code. For example, the first item is 100000042 , its last issue date was 21/5/2005 means before around 15 years. No one has withdrawn this material for maintenance purpose since 21/5/2005. I am targeting the similar situations in which the [ Plant Last Issue Dt ] is before more than 10 years from now.

 

Hopefully I could explain the idea well.

Regards.

 

Material1Disc.Base UnitDivisionCreated onStorage binMaterial TypePlant Last Issue DtAreaOn Hand QuantityOn Hand
Value
100000042BREAKER,CRCT,GAS,3 P,#FG22000AEachRR21/05/2005W2R-AD-07AZCAP21/05/2005COA10.00
100000091DESICCANT:DRYING,SILICA GEL,GRANULAR,(3)EachRR04/05/2005A2S-AB-03AZCAP15/10/2018COA170.00
100000093COIL,ELEC,CLOSING AND TRIPPING,1020 W,#4EachDM04/05/2005W1R-AB-06AZCAP04/05/2005COA140.00
100000153BREAKER,CRCT,MC,600V,2 POLE,10 A,#SA3210EachRR10/05/2005M1S-AC-05EZCAP10/05/2005COA10.00
100000183SWITCH,PRES,1P2T,28 MM FLANGE,GP,#147181EachRR07/05/2005W1R-AB-41AZCAP07/05/2005COA20.00
100000310BUSHING,ELECTRICAL CONDUCTOR,POWER TRANSEachRR31/05/2005#ZCAP31/05/2005COA210.00
100000432ADHESIVE:BONDING,PLIOBOND 20,CANEachIS25/06/2005A1S-AF-02FZSTK25/06/2005COA10.04
100000432ADHESIVE:BONDING,PLIOBOND 20,CANEachIS25/06/2005A2S-AB-01DZSTK25/06/2005COA20.08
100000509BREAKER,CRCT,MC,415 VAC/440 VDC,2 POLEEachRR23/07/2005#ZCAP09/07/2017COA50.00
100000646BUSHING,ELECTRICAL CONDUCTOR,CEI EN 6013EachRR28/06/2010Y5B-AB-06AZSTK28/06/2010COA11.00
100000908DEVICE: NO MODIFIEREachRR20/05/2006WH-AA-06AZSTK20/05/2006COA3634,958.83
100000955ADAPTER,TUBE,GAUGE,GAS INSULATED SWITCHGEachRR16/01/2013S1B-AA-02AZSTK11/04/2018COA3367.91
100000967NUT,HEX,STL,M12 DIA,1.75 MM,10 MM HT,#6KEachRR22/05/2006WH-DD-01BZCAP22/05/2006COA720.00
100000968WASHER,FLAT,RD,STL,13 MM ID,2.5 MM TH,#NEachRR22/05/2006WH-DD-01BZCAP22/05/2006COA980.00
100001002CHANGER,TAP,132KV VOLT,#IZSE5492106REV3EachRR10/04/2005S1B-AA-02BZCAP25/12/2013COA10.00
100001014TFMR,PWR,30/50 MVA KVA,3 P,132KV,33KV,#TEachRR20/04/2005O/01 7 11ZSTK20/04/2005COA22.00

Hi @freevission2019 
Thank you for the explanation. Try this:

Countrows Measure = 
VAR _tenYears =
    TODAY () - 10 * 365.25
VAR _count =
    COUNTROWS ( FILTER ( myTable, myTable[Plant Last Issue Dt] < _tenYears ) )
RETURN
    _count

 My table is called myTable.  (All dates in my picture may not match exactly but the years are correct.) 

Sum On Hand =
VAR _tenYears =
    TODAY () - 10 * 365.25
VAR _calc =
    SUMX (
        FILTER ( myTable, myTable[Plant Last Issue Dt] < _tenYears ),
        myTable[On Hand Quantity]
    )
RETURN
    _calc

 

warehouse1.PNG

 

 
Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel







Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi @Nathaniel_C 

Thanks for your effort.

I liked the measure that you have created and I applied it, but unfortunately it did not give the expected results. I tried also COUNTX and it gave the same result as yours. 

 

can you examine the measure based on the data that I provided in the previous post.

 

Regards

Hi @Nathaniel_C ,

 

I examined the measure on the data above and I found it PERFECT 🙂 , but when I applied the same on the whole data it gave strange result. what do you think the problem is?

 

 

Hello @freevission2019 ,
Without more information, I cannot guess, can you share your pbix?
Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors