This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hello - How can I create a measure to validate the values in all columns?
If the Type is 000123 - the length of the description column value is 16 and the first 4 numbers start with 1111 and end with 2222.
If True return Valid else return Invalid
Table 1 - Test Number
| Type (Text Column) | Number (Description |
| 000123 | 1111XXXXXXXXXXXX2222 |
| 000123 | 1111XXXXXXXXXXXX2221 |
| 000123 | 1111XXXXXXXXXXXX2200 |
| 000123 | 0011XXXXXXXXXXXX2222 |
| 000123 | 1111XXXXXXXXXXXX2222 |
| 0023245 | 0000XXXXXXXXX000 |
| 0023245 | 0000XXXXXXXXX00011 |
| 0023245 | 2200XXXXXXXXX00011 |
Solved! Go to Solution.
Hi @gauravnarchal ,
I have created a simple sample, please refer to it to see if it helps you.
Create a measure.
Measure =
VAR _left =
LEFT ( MAX ( 'Table'[Number (Description] ), 4 )
VAR _right =
RIGHT ( MAX ( 'Table'[Number (Description] ), 4 )
RETURN
IF (
MAX ( 'Table'[Type (Text Column)] ) = "000123"
&& _left = "1111"
&& _right = "2222",
"Valid",
"InValid"
)
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Rongtie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
|---|---|
| 32 | |
| 26 | |
| 23 | |
| 22 | |
| 15 |
| User | Count |
|---|---|
| 63 | |
| 45 | |
| 28 | |
| 24 | |
| 22 |