The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I have been trying to get this calculation column together, but have not been able to succeed. If the syntax is Value.ReplaceType(any value, new type) what's going on with this error code? I thought Duration.Days requires numbers, not dates, so how do I convert it?
M Query
Error Code
If you have any better routes to take, I'm all ears. I just want to be able to upload an excel report, and based on the invoice date show me how many days old it is.
Side curiosity, is there a difference between Referencing and Duplicating a table? I feel like there must be but I can't figure it out.
Solved! Go to Solution.
I don't know where you got that idea. But:
= Table.AddColumn(#"Previous Step", "Duration", each Duration.Days(Date.From(DateTime.LocalNow()) - [Invoice Date]), Int64.Type)
Replace #"Previous Step" with the name of the Step preceding this line of code that contains the table to which you want to add the "Duration" column
I don't know where you got that idea. But:
= Table.AddColumn(#"Previous Step", "Duration", each Duration.Days(Date.From(DateTime.LocalNow()) - [Invoice Date]), Int64.Type)
Replace #"Previous Step" with the name of the Step preceding this line of code that contains the table to which you want to add the "Duration" column
Thank you! A lot of this I'm able to work through based on intuition and the definition guide, but I was pulling my hair out with that one. Worked like a charm!