Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi,
I have created a table showing all the barcodes available in the warehouse but I cannot get the date difference between the purchase date (corresponding to the barcode) and today. Can you please help?
Solved! Go to Solution.
Hello @AmeenVanakar ,
Please try the below formula and please make sure the Puchase date is in date format.
Stock_Age = DATEDIFF(Warehouse_Stock[PURCHASE DATE], TODAY(), DAY)
If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes 👍 are much appreciated!
Thank You
Dharmendar S
Hey @AmeenVanakar
Please make some changes in measure
Please Kudos and Accept it as solution so other community member get helped
Thank You
Hey @AmeenVanakar
Please make some changes in measure
Please Kudos and Accept it as solution so other community member get helped
Thank You
Hello @AmeenVanakar ,
Please try the below formula and please make sure the Puchase date is in date format.
Stock_Age = DATEDIFF(Warehouse_Stock[PURCHASE DATE], TODAY(), DAY)
If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes 👍 are much appreciated!
Thank You
Dharmendar S
No luck! It's still throwing errors. I am looking for the date difference corresponding to the unique barcodes
Please share the Dummy Pbix file
Hey @AmeenVanakar
Here is the solution
Just made the relationship between these two tables
then the measure mentioned by @dharmendars007 will work and you will get the expected output
PBIX File link
Unable-to-get-the-number-of-days-between-2-dates-in-a-calculated Solved
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
Thanks @elitesmitpatel
I also noticed that you have made changes to the "Stock age range" column & it seems to be a circular reference. Any idea how to solve this? I need to use this column as a filter.