What is the NOW function?
The NOW function is a built-in DAX function that returns the current date and time according to the system clock of the computer running Power BI. The result is displayed as a datetime value in the format of “yyyy-mm-dd hh:mm:ss”.
How to use the NOW function in Power BI?
To use the NOW function in Power BI, you need to follow these steps:
1. Open Power BI Desktop.
2. Create a new report or open an existing one.
3. Click on the “Modeling” tab in the ribbon menu.
4. Click on “New Measure” to create a new measure.
5. In the formula bar, type “NOW()” (without the quotes).
6. Press Enter to confirm the formula.
7. Give a name to the measure, for example, “Current Time”.
8. Press Enter again to save the measure.
9. Drag and drop the measure onto a visual element in your report, such as a card or a table.
10. The visual element will display the current date and time according to the system clock of the computer running Power BI.
What are the use cases of the NOW function?
The NOW function can be used in various scenarios in Power BI, such as:
1. To display the current date and time on a dashboard or report.
2. To calculate the time difference between two datetime values.
3. To filter data based on the current date and time.
4. To schedule data refreshes or data exports based on the current date and time.
5. To create alerts or notifications based on the current date and time.
Best practices for using the NOW function
When using the NOW function in Power BI, it is important to keep the following best practices in mind:
1. Use the NOW function sparingly, as it can slow down the performance of your report or dashboard if used excessively.
2. Format the output of the NOW function using the Text function, to display the datetime value in a user-friendly format.
3. Use the TODAY function instead of the NOW function if you only need the current date (without the time).
4. Use the UTCNOW function instead of the NOW function if you need to display the current date and time in UTC timezone.
The NOW function is a powerful tool in the Power BI arsenal, allowing users to display the current date and time according to the system clock of the computer running Power BI. By following the steps outlined in this article, and keeping in mind the best practices, you can leverage the NOW function to create insightful dashboards and reports in Power BI.
Power BI DAX Training Courses by G Com Solutions (0800 998 9248)
Power BI DAX Intensive Training Course£1,050.00 – £26,550.00
Power BI DAX Introduction£395.00 – £9,750.00
Power BI DAX Intermediate£395.00 – £9,750.00
Power BI DAX Advanced£395.00 – £9,750.00