Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
gauravnarchal
Post Prodigy
Post Prodigy

Validate - Measure

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
0001231111XXXXXXXXXXXX2222
0001231111XXXXXXXXXXXX2221
0001231111XXXXXXXXXXXX2200
0001230011XXXXXXXXXXXX2222
0001231111XXXXXXXXXXXX2222
00232450000XXXXXXXXX000
00232450000XXXXXXXXX00011
00232452200XXXXXXXXX00011

 

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

2 REPLIES 2
Anonymous
Not applicable

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"
    )

vrongtiepmsft_0-1704850667784.png

 

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.

 

 

 

 

 

Ahmedx
Super User
Super User

pls try this

Screenshot_1.png

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors
Top Kudoed Authors