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
MarcUrdang
Post Patron
Post Patron

date creation

Good afternoon

 

I have two tables. In the one I split a particular date into a DAY , MONTH and YEAR. I need to use the MONTH and YEAR from this table and the DAY from another table in this way:  

 
Payment Date = date('Payment Summary'[Payment Year],'Payment Summary'[Payment MONTH use],'Payment Summary'[Payment DAY related])
 
However as I add data into the Excel datasource I get this error (although it mostly happens .. it sometimes doesn't) and I have no idea why. The error is:  An argument of function 'DATE' has the wrong data type or the result is too large or too small
 
I have no idea how to resolve this. Is there a better way to join those columns into a DATE?
 
thanks
Marc
1 ACCEPTED SOLUTION

I have issues with Teams. It doesn't work well with me.

But send me your email and I'll send you a Zoom meeting invitation.

Ken Tyler





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


View solution in original post

5 REPLIES 5
kentyler
Solution Sage
Solution Sage

VAR pay_year ='Payment Summary'[Payment Year]

VAR pay_month = 'Payment Summary'[Payment MONTH use]

VAR pay_day = 'Payment Summary'[Payment DAY related]

VAR pay_year_OK = pay_year >0

VAR pay_month_OK = pay_month > 0 && pay_month <=12

VAR pay_day_OK = pay_day > 0 && pay_day <=31

Result = IF(pay_year_OK && pay_month_OK && pay_day_OK,date(pay_year,pay_month,pay_day), "Error in year, month or day")

RETURN Result

 

You could put more complex logic on the limits for pay_day depending on the value of pay_month

 





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


Hi .. thank you so much for your quick response .. I am a fairly new user adn although I'm sure what you sent is fairly easy I am not entirely sure how to do replicate in my model. Would you be able to spend a minute via Teams so I can share my screen and you can talk me through it?

 

thanks

Marc

I have issues with Teams. It doesn't work well with me.

But send me your email and I'll send you a Zoom meeting invitation.

Ken Tyler





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


Hi Ken

thanks so much... I can't use Zoom on my work laptop so I'm going to quickly transfer the file to my peronsal laptop.

 

My mail is: marcurdang@gmail.com

 

I should be ready in 15 minutes.

 

thanks so much

Marc

Greg_Deckler
Super User
Super User

Well, would need to better understand the data to say anything definitive. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

But I suppose you might need to check to make sure that you are not getting a text value or something odd for your Payment Day Related.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.