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
Paulyeo11
Impactful Individual
Impactful Individual

How to compute inventory stock amount from last year 1/1/2019 till 14/10/2019 ?

1 ACCEPTED SOLUTION

@Paulyeo11 

 

Try this formula:

 

Calc = CALCULATE(SUM(INVENTORY[C/D]), DATEADD(DATESYTD('Date'[Date]), -1, YEAR))

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@Paulyeo11 , with a date table joined with posting date use time intelligence

 

YTD Sales = CALCULATE(SUM(Table[C/D]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Table[C/D]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Hi Amit

Thank you for your help.

https://www.dropbox.com/s/e6s13jegi5e1jbr/preWebinarPostCal_PY_DATA%20V006.pbix?dl=0

I use your suggested expression , i get null amount. LYTD stock amount should be from day 1 stock and end at today.

For your info the YTD stock amount is compute from day 1 stock transaction that is jan 2018 and end at today date. Not just for this year stock transaction.

Paulyeo11_0-1602669564442.png

 

@Paulyeo11 

 

Try this formula:

 

Calc = CALCULATE(SUM(INVENTORY[C/D]), DATEADD(DATESYTD('Date'[Date]), -1, YEAR))
themistoklis
Community Champion
Community Champion

@Paulyeo11 

 

Without a formula you can simply click on the object and on Filters Pane --> Filters on this visual --> Add Year --> Select 2019

 

See image below

Year.JPG

Hi Sir

Thank you for your offer.

As my requirement is put the expression to gauge chart . Hope some one can share with me.

Paul

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.