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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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