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
Anonymous
Not applicable

Calculated Column needs to be created based on two existing Column Dimensions

I have 2 columns in my data set Column A and Column B. I need to create a calculated column based on the combination of Column A and Column B. In a normal scenario a nested IF statement will be enough.

 

But in real time i have 5 distinct values in Column A and around 70 distinct values in Column B and there are around 140+ combinations of both the column data in the data set. The users have provided the mapping for these 140+ combinations.

 

I have somehow managed to manyally input all the combinations in a nested IF statement but that is not frasible and may have lot fo errors and hard to maintain. 

 

Need help to simplify this and assign to the calculated column output. Kindly suggest best ways to do it.

 

Sample DataSet for reference:

karthigeyan_0-1622111276632.png

 

6 REPLIES 6
v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

 

Actually we need to know the logic of the new calculated column so that we could improve the performance effectively, please provide more details.

 

Best Regards,
Eyelyn Qin

Anonymous
Not applicable

How about using the excel sheet itself as a data source?

Anonymous
Not applicable

Data source is SQL Database and there are thouands of records. 

Anonymous
Not applicable

Got it, if those mappings are final then we can import it into power bi and may be create a relationship with other tables that might need it. 

If the categories are less in numbers then we can go for switch statement but seems like there are many categories, therefore the best thing would be to load it and connect with other tables.

selimovd
Super User
Super User

Hey @Anonymous ,

 

so what exactly do you want to check?

Can you give an example?

 

Best regards

Denis

Anonymous
Not applicable

Hi Denis,

               I just gave a sample example for my requirement. Currntly i have writted n Nested IF iteration for the 140 actual Coulmn A & Column B combinations for the necessary output. That is not feasible and practical. I just want to identify a easier approach to get the values assigned to the calcuated column.

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.