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]))
cengizhanarslan
7 months agoSuper User
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]))