Forum Discussion
admin11
Memorable Member
5 years agoHow 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
- Greg_Deckler
Community Champion
admin11 You can use an Append query in Power Query Editor or you could use UNION in DAX.
- admin11
Memorable Member
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
Community 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 )
- AnonymousNot 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.