Reputation: 53
I have data column name "Loss Date" I want to create new column "Policy Date" based on this column and the condition is if Month<4 then display last year date otherwise not. actually, I want to create Policy Date column and I want to display in this bar chart which is given below, can anybody helps me regarding this in PowerBI?
Upvotes: 0
Views: 38
Reputation: 16908
In Power Query Editor, add a custom column with this below code-
=if Date.Month([loss date]) < 5 then "Apr-"& Text.From(Date.Year([loss date]) - 1) &" to Mar-"& Text.From(Date.Year([loss date])) else "Apr-"& Text.From(Date.Year([loss date])) &" to Mar-"& Text.From(Date.Year([loss date]) +1)
Here is the output-
Now you can use that new column to your chart for generating Bars.
Upvotes: 1