Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi,
i have an array with data from Micrsoft Forms like:
["other","option 1", "option2","otpion3"]
The OTHER is a free text, you can witre anything, i already create a column for each Option1/2/3 and count every time that question come in array.
My problem is determinte when the user choose the Other option.
My idea is determiate what cames in first place in array and if is diferent from Option 1/2/3 Create new column and write 1.
Can help with that?
Solved! Go to Solution.
Hi @Anonymous
Please check if below formula could help you.
Answer 1 =
VAR FirstText =
PATHITEM ( SUBSTITUTE ( Question[Q1], ",", "|" ), 1 )
RETURN
IF ( SEARCH ( "Answer 1", FirstText, 1, 0 ), 1, 0 )
Regards,
Cherie
Hi @Anonymous
I cannot fully understand it.Could you explain more about your expected output?You can upload the .pbix file to OneDrive and post the link here or send me via private message. Do mask sensitive data before uploading.Please follow this article How to Get Your Question Answered Quickly to post your question.
Regards,
Cherie
Hi @v-cherch-msft ,
Let me know if understand this exemple.
Windows Forms Survey (Same question, differents answers)
Q1. Exmple1:
Layout of array write in SQL Table
[“Free text”, “Answer 1”,” Answer 2”]
Q1. Exmple2:
Layout of array write in SQL Table;
[ “Answer 1”,” Answer 2”]
The problem is when the user chooses de other option, but the string always came in 1st position of array.
Column 1 = IF(SEARCH("Answer 1";(Survey_View[Exmple1]);1;0);1;0)
Column 2 = IF(SEARCH("Answer 2";( Survey_View[Exmple2]);1;0);1;0)
Column 3 = ???
RETURN PowerBI
User | Q1 | Column 1 | Column 2 | Column 3 |
USER 1 | [ “Answer 1”,” Answer 2”] | 1 | 1 | 0 |
USER 2 | [ “Answer 1”] | 1 | 0 | 0 |
USER 3 | [ “Free Text”,” Answer 2”] | 0 | 1 | 1 |
Hi @Anonymous
Please check if below formula could help you.
Answer 1 =
VAR FirstText =
PATHITEM ( SUBSTITUTE ( Question[Q1], ",", "|" ), 1 )
RETURN
IF ( SEARCH ( "Answer 1", FirstText, 1, 0 ), 1, 0 )
Regards,
Cherie
In part helps,
Todo what i want i created a column with first position of array then a create another column to calculate if exist what i want...
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 55 | |
| 37 | |
| 34 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 73 | |
| 70 | |
| 37 | |
| 35 | |
| 26 |