Forum Discussion

rjayathi's avatar
rjayathi
New Member
2 years ago
Solved

Creating new column in PowerBI data set with a formula

Hi 

In the data set imported in my PowerBi I have two coumns with different values but want to generate a 3rd column(IMT_SEGMENT) with a combination of different values in the first two columns(PROCESS,MONITOR_NAME) . Table shown here. For insTance using an IF statement, If PROCESS column=1276 AND IF=MONITOR_NAME=STRFC THEN IMT_SEGMENT=FIN-POLY. I have written scripts in JMP but don't know how to do it in PowerBI. Please help

Thanks

 

 

  • Hello rjayathi ,

     

    below you'll see the example you've mentioned and another if statement to know how to continue with it if you have more than the mentioned condition 

     

    PROCESS column = 
        IF(
            'YourTableName'[Process] = 1276 && 'YourTableName'[Monitor_Name] = "STRFC", 
            "FIN-POLY", 
            IF(
                'YourTableName'[Process] = 1277 && 'YourTableName'[Monitor_Name] = "AnotherValue", 
                "AnotherResult", 
                "DefaultResult"
            )
        )

2 Replies

  • Hi,

    As already suggested by another user, you will have to build another table.  Once that is in place, you can use the LOOKUPVALUE() function as well.  To receive specific help, share bothe tables in an format that can be pasted in an MS Excel file and show the expected result.

  • Hello rjayathi ,

     

    below you'll see the example you've mentioned and another if statement to know how to continue with it if you have more than the mentioned condition 

     

    PROCESS column = 
        IF(
            'YourTableName'[Process] = 1276 && 'YourTableName'[Monitor_Name] = "STRFC", 
            "FIN-POLY", 
            IF(
                'YourTableName'[Process] = 1277 && 'YourTableName'[Monitor_Name] = "AnotherValue", 
                "AnotherResult", 
                "DefaultResult"
            )
        )