March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello all.
I have two tables, equipment and snapshot. equipment has all assets, snapshot report on some issues with assets. snapshot has a date column called run_date, where the snapshot of the state of the assets was captured. equipment has a column called equipment_start_up_date, when the equipment was registered. both alos share a column called plant_key
Now, I want to create a calculated column in snapshot to capture how many new assets were created 30 days before the snapshot was captured. I created this:
Column =
Solved! Go to Solution.
DATEADD applies to the entire column. To shift individual dates you use EDATE.
@lbendlin I'm puzzled as to why I don't get the same result as you. In my dataset, both tables are related to a plant dimension and a date dimension, and plant key is a calculated column in snapshot. Finally, equipment has over 1,7 million rows.
Could any of this thing affect the outcome?
for example, for Dec 4, 2023, TC11BLO, you are getting 347 rows, which is the right amount. However, I get 0:
I'm seeing the filter is not taking into account the period of dates provided, only the specific day for that row, so it must find a perfect coincidence in plant and date to return anything.
Any idea?
Thanks again.
Please provide sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.
I understand full data may be required, but I'm restricted to share it. I ended up creating a measure, based on your ideas and the measure is working fine for my purposes, so this is good enough. Again, realy thnakful for the effort.
got it, thanks!
@lbendlin , 1 month is the right thing, you are right.
This solves it beautifully. Thank you very much.
If it was not too much to ask, would you mind to clarify why my implementation gave a wrong calculation?
Again, thanks for your time and help.
DATEADD applies to the entire column. To shift individual dates you use EDATE.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
22 | |
19 | |
17 | |
9 | |
5 |
User | Count |
---|---|
37 | |
29 | |
16 | |
14 | |
12 |