Forum Discussion
Q: Sumif using multiple columns and specific text
- 1 year ago
jns1087
Use the below M code for your resultList.Sum( Table.SelectRows( Source, each (_[Column B] = "APPLE" or _[Column B] ="KIWI") and _[Column C] = "DOG" and _[Column D] = "CAGE" and _[Column E] = "ORDINARY" and _[ColumnF] = "123-456" )[Amount] )Below screenshot
Hope it helps
Regards,
sanalytics - 1 year ago
Hi jns1087 ,
Thank you for reaching out to the Fabric Community.
And thanks for sharing the M code, sanalytics . I tested it on a sample dataset and it worked well the rows filtered for Apple + Kiwi with Dog, Cage, Ordinary, and 123-456 summed up to 345 as expected.I’ve attached a PBIX file for your reference if you’d like to review it further. Please let me know if you notice any changes that are needed.
I appreciate your support on this, sanalytics .
Regards,
Yugandhar.
Hi jns1087 ,
If you've had a chance to review the attached PBIX file.. If not, please take a look and let me know if you need any additional information or clarification to proceed.
Best regards,
Yugandhar.