Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I am trying to create a custom column using an if statement to report the following:
= each if [Asset Type] = "PC Tower" then [Year of Purchase] + 5 else 0
I want it to add 5 years to the "Year of purchase" based on its asset type.
This returns an error and need some help where I am going wrong.
Many Thanks
Jon
Solved! Go to Solution.
Hi,
each is wrong.
I have tried the following
if [FromCurrency]= "GBP" then [Year]+5 else [Year]
and it function.
in the formula bar it appears this way
= Table.AddColumn(#"Added Custom1", "Custom", each if [FromCurrency]= "GBP" then [Year]+5 else [Year])
pay attention to the type of your Year column
If this post is useful to help you to solve your issue, consider giving the post a thumbs up and accepting it as a solution!
Hi,
each is wrong.
I have tried the following
if [FromCurrency]= "GBP" then [Year]+5 else [Year]
and it function.
in the formula bar it appears this way
= Table.AddColumn(#"Added Custom1", "Custom", each if [FromCurrency]= "GBP" then [Year]+5 else [Year])
pay attention to the type of your Year column
If this post is useful to help you to solve your issue, consider giving the post a thumbs up and accepting it as a solution!
Sorted it, Many thanks for your help.
Jon
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
10 | |
7 | |
7 | |
6 | |
6 |