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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.