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

Dax time intelligence functions not working

Reading from Sage I have created in my transactions table a calculated column which contcatonates the month and last two digits of the year to make a code.

 

I then link them to a calnder table which untranslates the code as a date.

 

When reference that date field in DAX it returns nothing.  I can do the same in excel and it returns values, does powerbi handle dates differently?

 

Thanks

1 ACCEPTED SOLUTION

Hi @Anonymous,

Please help to post sample data and your expected result. If you want to use DATEVALUE function and CONCATENATE function in Power BI Desktop, you can review the following example.

Right click you table and choose “New column”, then you can write the following formula to return date values.

Column = DATEVALUE(CONCATENATE(CONCATENATE(CONCATENATE(Table1[Month],"/"),CONCATENATE(Table1[Day],"/")),Table1[Year]))

Column1 = DATEVALUE(CONCATENATE(CONCATENATE(CONCATENATE(Table1[Month],"/"),CONCATENATE("01","/")),Table1[Year]))

1.PNG


Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then 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-yuezhe-msft
Employee
Employee

Hi @Anonymous,

Based on the above information, it is difficult for us to analysis the cause of this issue.

Could you please help to post the sample data of the transactions table and calendar table? Also we need to know which formulas you use to create the calculated column and DAX expression that references date field. In addition, do you create relationship between the transactions table and calendar table? If so, which columns do you use in the two tables to link each other?



Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thanks lydia,

 

I was using a text field to link the two together, but it seems that if you want to use DAX intelligence functions you need to use date links?

 

Thanks

 

Chris

Hi @Anonymous,

Could you please post sample data of your tables? And we also need to know the detailed DAX formulas that you use and how you create the relationship between tables. We will appreciate it if you can post relevant screenshots.

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Capture.JPG

 

Thanks for getting back,  I was using calcode to link the tables which is whole number made up of year and month combined and in each row I have the relevent date that it refers to.

 

I have thought though about converting the date time to a date and then link it that way but not sure of the syntax.

 

Something like....

 

Column = DATEVALUE("01/"& CONCATENATE(Transactions[trans_period],"/"&Transactions[nlyear]))))

 

But that doesnt work.

 

Any help appreciated.

 

 

Hi @Anonymous,

Please help to post sample data and your expected result. If you want to use DATEVALUE function and CONCATENATE function in Power BI Desktop, you can review the following example.

Right click you table and choose “New column”, then you can write the following formula to return date values.

Column = DATEVALUE(CONCATENATE(CONCATENATE(CONCATENATE(Table1[Month],"/"),CONCATENATE(Table1[Day],"/")),Table1[Year]))

Column1 = DATEVALUE(CONCATENATE(CONCATENATE(CONCATENATE(Table1[Month],"/"),CONCATENATE("01","/")),Table1[Year]))

1.PNG


Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Brill thanks Lydia

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.