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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
butterscotch
Helper II
Helper II

cannot find name

Hello Everyone !

im having a trouble in formula where the column name cannot be found ,

i have table called Yard Loading that has column "Start Date", but when i put inside the formula, an error arise.

 

Norms Value = 
VAR CurrentMonth = [Current Month]
VAR MonthsSinceStart = [CurrentMonthSinceStart]
VAR ProjectDuration = [Duration (Month)]
RETURN
IF(
    ISBLANK(MonthsSinceStart) || ISBLANK(ProjectDuration),
    BLANK(),
    CALCULATE(
        SWITCH(
            TRUE(),
            CurrentMonth - MONTH('Yard Loading'[Start Date]") + 1 > ProjectDuration, BLANK(),  -- If current month exceeds project duration, return blank
            CurrentMonth - MONTH('Yard Loading'[Start Date]) + 1 = 1, 'Norm Loading'[Month1],
            CurrentMonth - MONTH('Yard Loading'[Start Date]) + 1 = 2, 'Norm Loading'[Month2],
            CurrentMonth - MONTH('Yard Loading'[Start Date]) + 1 = 3, 'Norm Loading'[Month3]
        ),
        FILTER('Norm Loading', 'Norm Loading'[Month] = CurrentMonth - MONTH('Yard Loading'[Start Date]) + 1)
    )
)

 

butterscotch_0-1704965033304.png

the error only happen in SWITCH().

Thank you in advance



1 ACCEPTED SOLUTION
butterscotch
Helper II
Helper II

I already find a solution for my issue, where instead of doing hard code like above, i forget that i can simply use relationship in model view and its done

View solution in original post

3 REPLIES 3
butterscotch
Helper II
Helper II

I already find a solution for my issue, where instead of doing hard code like above, i forget that i can simply use relationship in model view and its done

Anonymous
Not applicable

Hi @butterscotch ,

 

Please replace MONTH('Yard Loading'[Start Date])  with  MONTH(SELECTEDVALUE('Yard Loading'[Start Date])) 

Or   MONTH(MAX('Yard Loading'[Start Date])) 

 

Replace 'Norm Loading'[Month 1]  with SELECTEDVALUE('Norm Loading'[Month 1])

Or  MAX('Norm Loading'[Month 1])

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

lukiz84
Memorable Member
Memorable Member

and the error is?

 

it's not "cannot find" but "cannot find a single value" because you have to use min/max or any other function to get a single value

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors