To add a fiscal year in Power BI, you can follow these steps:
- Ensure your dataset has a column with the relevant date or timestamp.
- In the “Modeling” tab, click on “New Measure” under the “Calculations” section.
- In the “Formula” bar, you can use the following DAX formula to create a fiscal year measure:
Fiscal Year = IF(MONTH('TableName'[DateColumn]) < 7, YEAR('TableName'[DateColumn]) - 1, YEAR('TableName'[DateColumn]))
Replace ‘TableName’ with the actual name of your table and ‘DateColumn’ with the name of your date column. - Click on “OK” to create the measure.
- Navigate to your report or any visual where you want to display the fiscal year.
- Drag and drop the “Fiscal Year” measure onto the relevant visual or axis.
- You can further enhance the visual by formatting the fiscal year measure as desired, such as changing its data type to “Whole Number” or applying any necessary aggregation functions.
Example:
Let’s say you have a table named “Sales” with a column called “OrderDate” that contains the date of each order. You can follow the steps above and create a fiscal year measure using the following formula:
Fiscal Year = IF(MONTH('Sales'[OrderDate]) < 7, YEAR('Sales'[OrderDate]) - 1, YEAR('Sales'[OrderDate]))
Once you have the “Fiscal Year” measure, you can use it in various visuals and analysis to view and analyze data based on fiscal years instead of calendar years.