Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Flag= IF(VALUES(CCID_Data[conflict_notes_sk]) > 7 && CCID_Data[conflict_notes_sk] < 9 && CCID_Data[conflict_notes_sk] = all numbers, "Good", "Wrong")
Hopefully, this makes sense. Please let me know.
Solved! Go to Solution.
You can do this in the query editor too by adding a custom column with a formula like this (even though it has a "let" and "in" the whole thing goes in the pop up box when you add custom column.
= let midpart = Text.BetweenDelimiters([Note],"-","-")
in if Text.Length(midpart)<=9 and Text.Length(midpart)>=7 and (try Number.FromText(midpart) otherwise "error") <> "error" then "Valid" else "Invalid"
Or you can do it in a DAX column with a formula like this
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
You must have values that don't hany any hyphens and the SEARCH is returning 0. MID throws an error when the 2nd term/start position is 0. You will need to update the logic to avoid that scenario.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
You can do this in the query editor too by adding a custom column with a formula like this (even though it has a "let" and "in" the whole thing goes in the pop up box when you add custom column.
= let midpart = Text.BetweenDelimiters([Note],"-","-")
in if Text.Length(midpart)<=9 and Text.Length(midpart)>=7 and (try Number.FromText(midpart) otherwise "error") <> "error" then "Valid" else "Invalid"
Or you can do it in a DAX column with a formula like this
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Hi @mahoneypat ,
This is awesome, Thank you so much for the taking time to help me. Do you know I am getting a data type error on the second option?
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 66 | |
| 46 | |
| 42 | |
| 26 | |
| 19 |
| User | Count |
|---|---|
| 193 | |
| 124 | |
| 101 | |
| 67 | |
| 49 |