Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet 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
Hi,
I think I may have the Syntax for my Custom Column wrong, because my column ExpiryDateTest exists before the step to create the Custom column, but it dissappears after the step (see screenshots below)
My Add Custom1 command is:
Table.AddColumn(#"Renamed Columns", "Expired", each if [#"ExpiryDateTest"] <= DateTime.Date(DateTime.LocalNow()) then "Expired" else "Not-Expired").
Can anyone help me with what I have wrong in my Add Custom syntax?
Many thanks..
Solved! Go to Solution.
I see that the previos step before Added Custom1 is "Changed Type1", however you are using "Renamed Columns"
Can you once try:
Table.AddColumn(#"Changed Type1", "Expired", each if [#"ExpiryDateTest"] <= DateTime.Date(DateTime.LocalNow()) then "Expired" else "Not-Expired")
If this doesn't work, please provide the sample file removing all the sensitive data to have a better understanding of the issue.
Try:
Table.AddColumn(#"Renamed Columns", "Expired", each if [ExpiryDateTest] <= DateTime.Date(DateTime.LocalNow()) then "Expired" else "Not-Expired").
Hi PC2790,
Thanks for your rply.
I believe I've already tried this, but I copied and pasted your syntax and get the same message.
Just to clarify I see the below after creating the Custom Column
Then when I click on the field selector, its shows that the ExpriyDateTetst field is still there, but its not in the selection list.
When I de-select everything but the ''Expired' field, the ExpiryDateTest field disappers from the and all the rows in the collumn show Error.
Before creating the custom field, I used the ExpiryDateTest columnin a report and it brought back data.
I see that the previos step before Added Custom1 is "Changed Type1", however you are using "Renamed Columns"
Can you once try:
Table.AddColumn(#"Changed Type1", "Expired", each if [#"ExpiryDateTest"] <= DateTime.Date(DateTime.LocalNow()) then "Expired" else "Not-Expired")
If this doesn't work, please provide the sample file removing all the sensitive data to have a better understanding of the issue.
Hi PC2790,
Thanks for your help. Yes apologies, I'd missed that I was still referrring to an old step! I'll mark as solved! Cheers...
@ElsieCassin , I doubt the column name , it should be simply ExpiryDateTest
While creating a column, select from the right had side selection
if [ExpiryDateTest] <= DateTime.Date(DateTime.LocalNow()) then "Expired" else "Not-Expired"
Hi amitchandak,
Yes I tried this also, but see the same result
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
90 | |
84 | |
70 | |
49 |
User | Count |
---|---|
141 | |
121 | |
112 | |
59 | |
58 |