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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Steven_Wu
Frequent Visitor

How to convert the integer into date for calculation?

Hi, All,

I got a table as follow:

DateYear PeriodResult
2011-9-652016-9-6
2012-6-342016-6-3
2003-4-552008-4-5

 

Is there any way to add the Year Period(Integer) to the date for getting the Result column?

Because the table is generated in DAX, so I cannot use the Power Query for date calculation.

Hope to deal with this case with DAX.

Thank you~

1 ACCEPTED SOLUTION
JoBI
Resolver I
Resolver I

Hello,

You can do it this way:

Result = DATE(YEAR('Table'[Date])+'Table'[Year Period], MONTH('Table'[Date]), DAY('Table'[Date]))

 

If this post helps, then please consider accepting it as the solution to help other members find it more quickly. Thank You!!

 

View solution in original post

2 REPLIES 2
JoBI
Resolver I
Resolver I

Hello,

You can do it this way:

Result = DATE(YEAR('Table'[Date])+'Table'[Year Period], MONTH('Table'[Date]), DAY('Table'[Date]))

 

If this post helps, then please consider accepting it as the solution to help other members find it more quickly. Thank You!!

 

Thank you, JoBI~
It works~ Thank you so much~ 😀

 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.