Forum Discussion
bgierwi2
7 months agoAdvocate I
Grouping Data within unique date range - Add Custom Column
I have a data set, that I am looking to group I want to add a new custom column to allow me to group data from a date range I want to add a column so that all rows with the date 4/1/year to 3/31/ne...
- 7 months ago
If you need to do it within Power BI, you could create a calculated column as below:
Grouping = IF ( MONTH ( 'Table'[Date] ) >= 4, YEAR ( 'Table'[Date] ) + 1, YEAR ( 'Table'[Date] ) )OR
You could also make the same calculation with Power Query as below:
= Text.From(if Date.Month([Date]) >= 4 then Date.Year([Date]) + 1 else Date.Year([Date]))
rohit1991
7 months agoSuper User
Hii bgierwi2
To group dates into a unique April–March range, create a fiscal-year column based on the month of the date. The correct logic is: if the date’s month is April (4) or later, assign the grouping as Year + 1; otherwise assign the Year. This ensures that all dates from 4/1/2024 to 3/31/2025 map to 2025, 4/1/2025 to 3/31/2026 map to 2026, and so on, and it automatically continues for future years without any manual changes.