Forum Discussion
Tlotly
5 years agoHelper V
Create a custom column containing a variable
Good day Please assist. How do I create a column in powerquery with the following DAX? DefaultYear = if(YEAR(TODAY()) = 'Branch Scores'[FinYear], "DefaultYear" , 'Branch Scores'[FinYear]) ...
- 5 years ago
Hi Tlotly ,
Create a column as below:
=if [Year]=Date.Year(DateTime.LocalNow()) then "Default Year" else [Year]For my sample .pbix file ,pls see attached.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!
Anonymous
5 years agoNot applicable
Try this:
DefaultYear = Table.AddColumn (PriorStepName, "Year", each if Date.IsInCurrentYear([FinYear]) then "DefaultYear" else [FinYear])
--Nate
,
'Branch Scores'[FinYear])
- Tlotly5 years agoHelper V
Anonymous Thank you. It's complaining about PriorStepName not being recognised.