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.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
100 | |
80 | |
63 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |