The Power BI Designer gives you the options to add the custom date, time, and duration formulas to your datasets with simple menu selections. These formulas operate in the same way an Excel formula would if you were using the Power BI add-in for Excel. In this example, we will create a simple formula to calculate the number of days an opportunity has been open using the built-in functionality from the Power BI Designer.
Here is how we do this using the Opportunities dataset:
In the query view window, highlight the Created On column and then select Date | Age from the main menu bar under Add Column:
A new column called AgeFromDate will be created at the end of the dataset with the total number of days down to the second. Once the column appears, select Duration | Total Days from the main menu bar under Add Column to change the values to just the number for days:
Rename the column to Days Open to prepare the dataset for the reports.
For advanced calculations, you can adjust the...