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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

How to adding a Date type column with text type column (containing numbers)

Hello,

 

In excel I am using a formula  =IF(AY2<>"NA",(AE2+AZ2),"OPEN") to replicate the same but when I use custom column in Power BI, I am not able to do so.

 

I want to add a Date type ("AE") column with text type column ("AZ") (containing numbers) but power BI is returning error. 

 

I want to add numbers mentioned in columnn AZ and increment the dates in power BI.

scorpene_0-1643219548593.png

 

Please help

1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @Anonymous 

You can try this, create a calculated column,

Column =
IF (
    'Table'[Resolution Time] <> "NA",
    ( 'Table'[Logged Date] + 'Table'[Closure Days] ) & "",
    "OPEN"
)

vxiaotang_0-1643704034835.png

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-xiaotang
Community Support
Community Support

Hi @Anonymous 

You can try this, create a calculated column,

Column =
IF (
    'Table'[Resolution Time] <> "NA",
    ( 'Table'[Logged Date] + 'Table'[Closure Days] ) & "",
    "OPEN"
)

vxiaotang_0-1643704034835.png

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Can you please guide why you concatenated "" in the "True" condition ? Just wante dunderstand for my knowledge.

Hi @Anonymous 

( 'Table'[Logged Date] + 'Table'[Closure Days] ) & ""

it returns a date in text format, just like the format of "open". Otherwise, an error message will appear: Expressions that yield variant data-type cannot be used to define calculated columns. More information about this error, please see this link

vxiaotang_0-1643872373539.png

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

 

 

Anonymous
Not applicable

Thank you @v-xiaotang for your support. It worked.

amitchandak
Super User
Super User

@Anonymous , In power bi Closure days should be number, if there is NA value, replace that with null (all small null) in power query

and then you can simply add dates to date

 

Closure Date = [logged of date]  +[Closure days]

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

Thanks @amitchandak for your prompt answer. Please let me know how can we convert the remaining text values as null in that column.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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