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
BenwillLopez
Frequent Visitor

Create 1 column based in the values of two columns in the same table

Good Morning,

I am trying to create 4 columns (PRSQ5000,PRSQ5001,PRSQ5002, PRSQ5003; from column.question) taking the related value of another column named answer.

This is the expected outcome:

BenwillLopez_0-1664982225279.png

Tried this but did not work: 

Column = IF('KPI_SURVEY (3)'[QUESTION] = "PRSQ500", 'KPI_SURVEY (3)'[ANSWER], BLANK())

BenwillLopez_1-1664982398686.png

 

EXAMPLE DATA:

QUESTIONANSWER
PRSQ5000VERY SATISFIED
PRSQ5001SOMEWHAT SATISFIED

PRSQ5002

VERY EASY
1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @BenwillLopez 

Thanks for reaching out to us.

>>Column = IF('KPI_SURVEY (3)'[QUESTION] = "PRSQ500"'KPI_SURVEY (3)'[ANSWER]BLANK())

There is no problem with the grammar, please check if your string is spelled correctly, it seems that there is a 0 missing

column PRSQ5000= IF('KPI_SURVEY (3)'[QUESTION] = "PRSQ5000", 'KPI_SURVEY (3)'[ANSWER], BLANK())

column PRSQ5001= IF('KPI_SURVEY (3)'[QUESTION] = "PRSQ5001", 'KPI_SURVEY (3)'[ANSWER], BLANK())

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xiaotang
Community Support
Community Support

Hi @BenwillLopez 

Thanks for reaching out to us.

>>Column = IF('KPI_SURVEY (3)'[QUESTION] = "PRSQ500"'KPI_SURVEY (3)'[ANSWER]BLANK())

There is no problem with the grammar, please check if your string is spelled correctly, it seems that there is a 0 missing

column PRSQ5000= IF('KPI_SURVEY (3)'[QUESTION] = "PRSQ5000", 'KPI_SURVEY (3)'[ANSWER], BLANK())

column PRSQ5001= IF('KPI_SURVEY (3)'[QUESTION] = "PRSQ5001", 'KPI_SURVEY (3)'[ANSWER], BLANK())

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

Hello! I apologize for the late reply,

 

I tested your solution, it does almost answer my question.

 

Now, how I may be able to "eliminate" the spaces between ?

Can the First or Last calculation be an issue as per the displayed values ?

Screenshot for reference below:

BenwillLopez_0-1666104804652.png

Below expected result:

BenwillLopez_1-1666104851227.png

 

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.