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
FernandoCamargo
Regular Visitor

Hi All, Could someone help me with a custom column? I have a table "DateTransactionTable" with date

Hi All, Could someone help me with a custom column? I have a table "DateTransactionTable" with date and transaction number , and another table "LastTransactionMonth" with the last date of the month and the last transaction. I want to create a date costum column on table "DateTransactionTable" which if transaction number is greater than the last transaction of the month on table "LastTransactionMonth" and the date on table "DateTransactionTable" is less or equal to the last day of the monht on table "LastTransactionMonth" then add 30 days. See the code I wrote and comes up with error.

 

= Table.AddColumn(#"Changed Type", "NewDate", each if [Transaction] > (LastTransactionMonth[LastTransactionMonth]) and [Date] <= Date.From(LastTransactionMonth[LastTransactionDay]) then Date.AddDays([Date], 30) else [Date])

 

 

Error msg below Expression.Error: We cannot apply operator < to types List and Number. Details: Operator=< Left=[List] Right=1

2 REPLIES 2
artemus
Employee
Employee

Replace LastTransactionMonth with Table.Last(LastTransactionMonth).

 

Note there will be an error if LastTransactionMonth is empty

Hi Artemus,

Thank you so much, just saw the msg now.
I will try your suggestion out and get back to you.

Regards,
Fernando

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.

Top Solution Authors
Top Kudoed Authors