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
sshekar7
Frequent Visitor

data formating results in 1905

I have two fields employees and Year. I am using this formula to calculate growth rate.

 

Growth % = divide (sum(Data[EMPLOYEES]) - calculate(sum(Data[EMPLOYEES]),SAMEPERIODLASTYEAR(Data[YEAR])), calculate(sum(Data[EMPLOYEES]),SAMEPERIODLASTYEAR(Data[YEAR])))

 

I am using sum because i have other fields which slices the employment data.

 

This gives error because Year is not date field. In "Modeling" tab, if i set the format to date then all the values become 1905. I understand its converting year 2013 to number which excel understands but is there is a easier way to fix this? 

 

I assume there has to be easier way to convert year values to date that PBI can use for calculations like this.

1 ACCEPTED SOLUTION
Habib
Responsive Resident
Responsive Resident

You can use the below method to convert your year to date.

 

  1. Convert the data type of your Year column to Tex
  2. Add custom Column to and use below formula to append date and montht to Year filed

dateformat.png

  1. convert the new column type to date

 

Hopefully this will help.

View solution in original post

2 REPLIES 2
Habib
Responsive Resident
Responsive Resident

You can use the below method to convert your year to date.

 

  1. Convert the data type of your Year column to Tex
  2. Add custom Column to and use below formula to append date and montht to Year filed

dateformat.png

  1. convert the new column type to date

 

Hopefully this will help.

Thanks Habib.. it worked..

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.