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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
admin11
Memorable Member
Memorable Member

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 ?
 
admin11_0-1635806235585.png

 

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 5
Anonymous
Not applicable

Hi @admin11 ,

 

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

Eyelyn9_0-1635994882215.png

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.

Greg_Deckler
Community Champion
Community Champion

@admin11 You can use an Append query in Power Query Editor or you could use UNION in DAX.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@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

@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
  )


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler 

I have try , it does not work . 

admin11_0-1636026114363.png

 

Below is the link my PBI file :-

https://www.dropbox.com/s/6ol6l2dfhro49sg/PBT_V2021_113.pbix?dl=0

 

Paul

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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