This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreGet Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.
Hello,
I am trying to create a new measure or calculated column that will detect if "no" exists before "yes" within a row. If this instance does exist, the value would equal "1" or "true", and if this instance does not exist within that row, the value would equal "no" or "false". There are a total of 23 columns. Other values would possibly exist within this row , like "N/A" for example, but these would not matter when it comes to the result of no before yes.
Note: The no would not need to exist directly before the yes. For example, the row could read "No" "No" "Yes" "N/A" "No" "Yes"
Simply because a no reads before a yes within the row, the value would have to be "1" or "true".
Please help by providing a calculated column or a measure, thank you in advance.
Solved! Go to Solution.
In the query editor, you add a column with this formula:
List.PositionOf(Record.FieldValues(_), "No") < List.PositionOf(Record.FieldValues(_), "Yes")
if you need a case-insensitve check, you transfer to lower like this:
List.PositionOf(Record.FieldValues(Text.Lower(_)), "no") < List.PositionOf(Record.FieldValues(Text.Lower(_)), "yes")
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
In the query editor, you add a column with this formula:
List.PositionOf(Record.FieldValues(_), "No") < List.PositionOf(Record.FieldValues(_), "Yes")
if you need a case-insensitve check, you transfer to lower like this:
List.PositionOf(Record.FieldValues(Text.Lower(_)), "no") < List.PositionOf(Record.FieldValues(Text.Lower(_)), "yes")
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 25 | |
| 24 | |
| 22 | |
| 21 | |
| 19 |
| User | Count |
|---|---|
| 56 | |
| 52 | |
| 49 | |
| 25 | |
| 25 |