Forum Discussion
Assistance with IF Statement and Calculated Columns
- 6 years ago
Hi GeoffHill ,
How about the result after you follow the suggestions mentioned in my original post?
Could you please provide more details or expected result about it If it doesn't meet your requirement?Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
GeoffHill , You data structure id not very clear to me. You should have the brand as a column. with values Brand 1, brand 2 etc
If not so, unpivot and try
https://radacad.com/pivot-and-unpivot-with-power-bi
Transpose : https://yodalearning.com/tutorials/power-query-helps-transposing-data/
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Yes it is actually more complex.
This is one of many Salesforce Objects which forms the data table.
Columns Brand 1 - 11 are Conditional columns based on Response_c ( ie: if Response_c = Brand 1, then 1 in column Brand 1)
Essentially for the Score column - I want the value 1 in the column if the Sum of Brand 1:11 is greater than or equal to 2.
| Id | IsDeleted | Name | CurrencyIsoCode | CreatedDate | CreatedById | LastModifiedDate | LastModifiedById | SystemModstamp | Outlet_Survey__c | Content_Document_ID__c | Content_Version_ID__c | GUID__c | Response__c | Survey_Question__c | Outlet_Survey__r.Outlet__r.Name | Outlet_Survey__r.Outlet__r.Primary_Sales_Territory_Region__r.Name | Outlet_Survey__r.Outlet__r.Primary_Sales_Territory__r.Name | Outlet_Survey__r.Outlet__r.Region__r.Name | Outlet_Survey__r.Outlet__c | Outlet_Survey__r.Completion_Date__c | Survey_Question__r.Question__c | Survey_Question__r.Survey__r.Name | Last Called On | 365 Essentials Photo | 365 Off Survey | Brand 1 | Brand 2 | Brand 3 | Brand 4 | Brand 5 | Brand 6 | Brand 7 | Brand 8 | Brand 9 | Brand 10 | Brand 11 | BRAND SUM Column | BRAND Score |
| a0s3W0000027N7SQAU | FALSE | OSR-424366 | AUD | 29/05/2020 3:09 | 0051t000003mtcPAAQ | 29/05/2020 3:09 | 0051t000003mtcPAAQ | 29/05/2020 3:09 | a0t1t000003uiAKAAY | 70A08C63-B575-409B-999D-2AAB0B387083 | Brand 1 | a101t000008tBzpAAE | Outlet 1 | QLD | 0011t00000twRh3AAE | Friday, 29 May 2020 | What Brand Have You Executed (1) | 365 Essentials (Off) | Y | 1 | 1 | 1 | 0 | |||||||||||||||
| a0s3W0000027KXfQAM | FALSE | OSR-419715 | AUD | 27/05/2020 7:36 | 0051t000003jksiAAA | 27/05/2020 7:36 | 0051t000003jksiAAA | 27/05/2020 7:36 | a0t1t000003smRGAAY | 187958B7-06D9-4E15-B30D-737D317296C1 | Brand 2 | a101t000008tBzpAAE | Outlet 2 | WEST | 0011t00000pY84bAAC | Wednesday, 27 May 2020 | What Brand Have You Executed (1) | 365 Essentials (Off) | Y | 1 | 1 | 1 | 0 | |||||||||||||||
| a0s3W0000027Sb3QAE | FALSE | OSR-434028 | AUD | 2/06/2020 8:20 | 0051t000003jks2AAA | 2/06/2020 8:20 | 0051t000003jks2AAA | 2/06/2020 8:20 | a0t3W000001J4UAQA0 | 8D7BB575-EAB8-45C9-B5B4-92A26E69109B | Brand 1 | a101t000008tBzpAAE | Outlet 3 | NSW | 0011t00000twOkzAAE | Tuesday, 2 June 2020 | What Brand Have You Executed (1) | 365 Essentials (Off) | Y | 1 | 1 | 1 | 0 | |||||||||||||||
| a0s3W0000027E89QAE | FALSE | OSR-406990 | AUD | 22/05/2020 4:39 | 0051t000003jktNAAQ | 22/05/2020 4:39 | 0051t000003jktNAAQ | 22/05/2020 4:39 | a0t1t000003ucGSAAY | 11237781-32D6-46B9-B029-B5AB1C3CDF8F | Brand 7 | a101t000008tBzpAAE | Outlet 4 | SOUTH | 0011t00000twOnXAAU | Friday, 22 May 2020 | What Brand Have You Executed (1) | 365 Essentials (Off) | N | 1 | 1 | 1 | 0 | |||||||||||||||
| a0s3W0000027JxPQAU | FALSE | OSR-418568 | AUD | 27/05/2020 4:29 | 0051t000003jksdAAA | 27/05/2020 4:29 | 0051t000003jksdAAA | 27/05/2020 4:29 | a0t3W000001ItEQQA0 | 313C206B-7011-4E42-9242-D7E8950C5164 | Brand 3 | a101t000008tBzpAAE | Outlet 5 | QLD | 0011t00000twP6WAAU | Wednesday, 27 May 2020 | What Brand Have You Executed (1) | 365 Essentials (Off) | Y | 1 | 1 | 1 | 0 | |||||||||||||||
| a0s3W00000273XVQAY | FALSE | OSR-386895 | AUD | 14/05/2020 2:11 | 0051t000003jksUAAQ | 14/05/2020 2:11 | 0051t000003jksUAAQ | 14/05/2020 2:11 | a0t1t000003u3HIAAY | 92DEAA96-6AC8-4EC9-8984-E0DE67FD866B | Brand 8 | a101t000008tBzpAAE | Outlet 6 | QLD | 0011t00000twPF1AAM | Thursday, 14 May 2020 | What Brand Have You Executed (1) | 365 Essentials (Off) | Y | 1 | 1 | 1 | 0 |
- v-zhenbw-msft6 years ago
Community Support
Hi GeoffHill ,
How about the result after you follow the suggestions mentioned in my original post?
Could you please provide more details or expected result about it If it doesn't meet your requirement?Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- GeoffHill6 years agoFrequent Visitor
Thanks, i managed to solve this issue.
Cheers,