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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Anonymous
Not applicable

## Calculated Column not working

I have a calculated column using the formula below.......the result returned is not as expected.

ACT/FC = IF([FP Year]<[Current Year]||[FP Month]<[Current Month],"Actual","Forecast")

The value returned for Jan 23 - Sep 23 should be "Forecast" but its returning "Actual"??

Can anyone help? Thanks

1 ACCEPTED SOLUTION
Memorable Member

Hi @Anonymous ,

Try this instead:

``````ACT/FC =
VAR _FPDate = DATE([FP Year], [FP Month], 1)
VAR _CurrDate = DATE([Current Year], [Current Month], 1)

RETURN

IF(_FPDate < _CurrDate, "Actual", "Forecast")``````

Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!
5 REPLIES 5
Anonymous
Not applicable

Thanks but that hasnt worked either, result below using AND

Memorable Member

Hi @Anonymous ,

Try this instead:

``````ACT/FC =
VAR _FPDate = DATE([FP Year], [FP Month], 1)
VAR _CurrDate = DATE([Current Year], [Current Month], 1)

RETURN

IF(_FPDate < _CurrDate, "Actual", "Forecast")``````

Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!
Anonymous
Not applicable

Thanks but that didnt work either, delivered the same result as the original formula

Anonymous
Not applicable

Sorry made a typo, yes this formula has worked ok, thanks for your help

Memorable Member

Hi @Anonymous ,

I think you need to adjust your formula to use AND instead of OR:

``ACT/FC = IF([FP Year] < [Current Year] && [FP Month] < [Current Month], "Actual", "Forecast")``

Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

## Helpful resources

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

#### Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors
Top Kudoed Authors