Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Combine Year and Accounting Period from two separate columns into a new column

Hello,

 

The data that I export from my financial systems has no date per se, only a year and period number according to our fiscal year. For example 2020-P1 = April 2020 etc. The data looks like this:

Period.JPG

 

I require to know how many  working days are in each fiscal Year/ Period require to compare the data from one period to another so I figured that my first step was to create a calendar table which I did which also calculates the working days and Fiscal Month and Fiscal Quarter. Since my data is presented in Year / Period, how do I go about creating a Column in my Calendar which also reflects Year / Period ? Do I even need to do this in order to create the relationship between the Calendar and my Data? Here is my Calendar thus far:

 

Calendar.JPG

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , in date table you can create like

 

Date = [year]&"-P" & [FY Month]

 

in Table

new date =
var _pos = search("P",[Year Period],,0)
return
format(date(left([Year Period],4), right([Year Period],len() -_pos),1),"MMM-YYYY")

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , in date table you can create like

 

Date = [year]&"-P" & [FY Month]

 

in Table

new date =
var _pos = search("P",[Year Period],,0)
return
format(date(left([Year Period],4), right([Year Period],len() -_pos),1),"MMM-YYYY")

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hello Date = [year]&"-P" & [FY Month] worked Great!

 

However I don't understand the purpose of new date =
var _pos = search("P",[Year Period],,0)
return
format(date(left([Year Period],4), right([Year Period],len() -_pos),1),"MMM-YYYY")

 

I tried to entere it in a new column to gain understanding but I get an error 

 

error.JPG

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.