Forum Discussion

admin11's avatar
admin11
Icon for Memorable Member rankMemorable Member
5 years ago

How to compute Stock Aging Amount by year ?

Hi All

 

I have below syntax working fine :-

_SLOW_1_YEAR =
IF (
TODAY () - SELECTEDVALUE ( INVC[Last Sales] ) >1 * 365
&& SELECTEDVALUE ( INVC[Last Sales] ) <> BLANK (),
1,
0
)
 
_SLOW_2_YEAR =
IF (
TODAY () - SELECTEDVALUE ( INVC[Last Sales] ) >2 * 365
&& SELECTEDVALUE ( INVC[Last Sales] ) <> BLANK (),
1,
0
)
 
Now i create 5 seperate table.
 
May i know how to combine 5 table into 1 , So that i can display the sales contribution by year 1 to year 5 ?
 

 

Hope some one can advise me.

 

So that my report look like below :-

Year 1     20%

Year 2     30%

Year 3     40%

ETC

Paul

5 Replies

    • admin11's avatar
      admin11
      Icon for Memorable Member rankMemorable Member

      Greg_Deckler 

      Thank you very much for your fast reply. 

      Actually what i need to combine the below 2 syntax into 1 :-

       
      _SLOW_1_YEAR =
      IF (
      TODAY () - SELECTEDVALUE ( INVC[Last Sales] ) >1 * 365
      && SELECTEDVALUE ( INVC[Last Sales] ) <> BLANK (),
      1,
      0
      )
       
      _SLOW_2_YEAR =
      IF (
      TODAY () - SELECTEDVALUE ( INVC[Last Sales] ) >2 * 365
      && SELECTEDVALUE ( INVC[Last Sales] ) <> BLANK (),
      1,
      0
      )
       
      So i can know 1 year and 2 year slow moving amount.
      Paul
      • Greg_Deckler's avatar
        Greg_Deckler
        Icon for Community Champion rankCommunity Champion

        admin11 Just use a SWITCH(TRUE(), ) statement and put your IF true/false statements in as conditions, like:

        _SLOW_YEAR =
          SWITCH(TRUE(),
            TODAY () - SELECTEDVALUE ( INVC[Last Sales] ) >1 * 365
        && SELECTEDVALUE ( INVC[Last Sales] ) <> BLANK (),1,
            TODAY () - SELECTEDVALUE ( INVC[Last Sales] ) >2 * 365
        && SELECTEDVALUE ( INVC[Last Sales] ) <> BLANK (),1,
            0
          )
  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi admin11 ,

     

    You may create a Year table and then use SWITCH() to match values:

    Measure = SWITCH(MAX('New Table'[Value]),"Year 1", [_SLOW_1_YEAR], "Year 2",[_SLOW_2_YEAR],"Year 3", [_SLOW_3_YEAR])

     

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