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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Microsoft Employee
Microsoft 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.