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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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")

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")

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.