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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Durbslaw
Helper I
Helper I

Nested IF measure

Hi Forum,

 

Thanks for reading and responses where applicable, technically this is not a measure but I have...

Programme =
if('Department'[ProgrammeCode] = 10000000, "Prog 1",
if('Department'[ProgrammeCode] = 20000000, "Prog 2" ,
if('Department'[ProgrammeCode] = 30000000, "Prog 3" ,
if('Department'[ProgrammeCode] = 40000000, "Prog 4" ,
if('Department'[ProgrammeCode] = 50000000, "Prog 5" ,
if('Department'[ProgrammeCode] = 60000000, "Prog 6" ,
if('Department'[ProgrammeCode] = 70000000, "Prog 7" ,
if('Department'[ProgrammeCode] = 80000000, "Prog 8" ,BLANK()))))))))

 

The issue is the engine does not recognise the field name 'ProgrammeCode'. I have checked the spelling and even modified a quick measure to retain the field name.

1 ACCEPTED SOLUTION
Samarth_18
Community Champion
Community Champion

HI @Durbslaw ,

 

You could create a measure as below:-

 

Programme =
SWITCH (
    TRUE (),
    MAX ( 'Department'[ProgrammeCode] ) = 10000000, "Prog 1",
    MAX ( 'Department'[ProgrammeCode] ) = 20000000, "Prog 2",
    MAX ( 'Department'[ProgrammeCode] ) = 30000000, "Prog 3",
    MAX ( 'Department'[ProgrammeCode] ) = 40000000, "Prog 4",
    MAX ( 'Department'[ProgrammeCode] ) = 50000000, "Prog 5",
    MAX ( 'Department'[ProgrammeCode] ) = 60000000, "Prog 6",
    MAX ( 'Department'[ProgrammeCode] ) = 70000000, "Prog 7",
    MAX ( 'Department'[ProgrammeCode] ) = 80000000, "Prog 8",
    BLANK ()
)

And column can be create as below:-

Programme =
SWITCH (
    TRUE (),
    'Department'[ProgrammeCode] = 10000000, "Prog 1",
    'Department'[ProgrammeCode] = 20000000, "Prog 2",
    'Department'[ProgrammeCode] = 30000000, "Prog 3",
    'Department'[ProgrammeCode] = 40000000, "Prog 4",
    'Department'[ProgrammeCode] = 50000000, "Prog 5",
    'Department'[ProgrammeCode] = 60000000, "Prog 6",
    'Department'[ProgrammeCode] = 70000000, "Prog 7",
    'Department'[ProgrammeCode] = 80000000, "Prog 8",
    BLANK ()
)

 

BR,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

1 REPLY 1
Samarth_18
Community Champion
Community Champion

HI @Durbslaw ,

 

You could create a measure as below:-

 

Programme =
SWITCH (
    TRUE (),
    MAX ( 'Department'[ProgrammeCode] ) = 10000000, "Prog 1",
    MAX ( 'Department'[ProgrammeCode] ) = 20000000, "Prog 2",
    MAX ( 'Department'[ProgrammeCode] ) = 30000000, "Prog 3",
    MAX ( 'Department'[ProgrammeCode] ) = 40000000, "Prog 4",
    MAX ( 'Department'[ProgrammeCode] ) = 50000000, "Prog 5",
    MAX ( 'Department'[ProgrammeCode] ) = 60000000, "Prog 6",
    MAX ( 'Department'[ProgrammeCode] ) = 70000000, "Prog 7",
    MAX ( 'Department'[ProgrammeCode] ) = 80000000, "Prog 8",
    BLANK ()
)

And column can be create as below:-

Programme =
SWITCH (
    TRUE (),
    'Department'[ProgrammeCode] = 10000000, "Prog 1",
    'Department'[ProgrammeCode] = 20000000, "Prog 2",
    'Department'[ProgrammeCode] = 30000000, "Prog 3",
    'Department'[ProgrammeCode] = 40000000, "Prog 4",
    'Department'[ProgrammeCode] = 50000000, "Prog 5",
    'Department'[ProgrammeCode] = 60000000, "Prog 6",
    'Department'[ProgrammeCode] = 70000000, "Prog 7",
    'Department'[ProgrammeCode] = 80000000, "Prog 8",
    BLANK ()
)

 

BR,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

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