Forum Discussion
Table.TransformColumns Error
Hey sjpaq ,
as far as I understand it's not possible to reference other columns in the Table.TransformColumns function:
"It’s important to note that a transformation can only take place on a column itself"
But you can add it as a new column and then delete the old one:
= Table.AddColumn(#"Changed Type", "Custom", each if [Amount] is null and [IndName] = "Response Costs" then [Hours] * [Hourly Rate] else [Amount])
If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
Best regards
Denis
Blog: WhatTheFact.bi
Follow me: twitter.com/DenSelimovic
Thank you Denis
I'm very close with your suggestion. The column [Hours] is on the original table, the column [Hourly Rate] is a lookup value set in a previous step (= Table.ExpandTableColumn(#"Merged Queries", "RankHourlyRates", {"Hourly Rate"}, {"Hourly Rate"})) and I cannot reference it in my multiplication. I get the following error.
Expression.Error: The field 'Hourly Rate' of the record wasn't found.
Details:
Breach=BR_Cyber Star 2024
Date=2/1/2024
Team Member Name=CTI0
Rank=Capt
Group or Cell=CTI
Activity=Detect
Hours=8
any ideas?