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

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.

Reply

Cell Validation - Should only have 3 Digit number

Hello

 

How can i do cell validation to check if the value updated in the column (Number) is 3 digit number using a measure. Else it should return as a error.

 

Thanks

 

ProductNumber
Drum111
Drum122
Drum123
Drum134
Drum133C
Drum133
Glass133
Glass145
Glass134A
Plate123B
Plate1234
Glass12344
Drum12334
3 REPLIES 3
v-shex-msft
Community Support
Community Support

Hi @gaurav-narchal,

AFAIK, Dax expression and calculate fields can calculate with the raw field but not able to direct change raw field values.
In my opinion, I'd like to suggest you enter to 'query edit' side to do custom with the 'replace value' function to replace these no matched values.
Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
gdarakji
Resolver III
Resolver III

One thing to note is that this is impossible to achieve through a measure. Your requirement to validate the field row-wise. You should use custom columns for row-wise computations. Measures are meant to aggregate values over multiple rows.

jonoling
Frequent Visitor

Hi gaurav,

 

You have two options:

  1. Using Power Query, you can add a conditional column to the table:
    • If Text.Length([Number]) = 3 then True else False
  2. Alternatively the LEN() function in DAX will also work as a new Calculated Column:
    • Cell Validation Check = IF(LEN(Table1[Number]) = 3, TRUE(), FALSE())

You can then filter by the new column to find cells with only 3 digits.

Hope this helps.

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.