I have a power pivot model whith an invoice table. In each line I have invoice number, due date and invoice amount.
I need to calculate the number of days between a "date parameter" and due date. How can do that?
Technology Tips and News
I have a power pivot model whith an invoice table. In each line I have invoice number, due date and invoice amount.
I need to calculate the number of days between a "date parameter" and due date. How can do that?
Hi Mdenis,
According to your description, you need to get the number of days between a "date parameter" and the due date which is a column in your invoice table, right?
Microsoft Excel and PowerPivot internally stores dates and times as number representing the number of days since 1900-Jan-0, plus a fractional portion of a 24 hour day ddddd.tttttt. This number is called serial date-time. To see this serial date-time
value you should multiple date value by 1.0 (or 1.). Lets say you have column Date1 with value "21/12/2009 21:00:00". If you will create PowerPivot formula "= 1. * [Date1]", then result of this new calculation will be "40168.88".
So you can use the DAX expression below to get the number of days between a "date parameter" and the due date.
=1. * ([Date2]-[Date1])
Regards,