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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Syndicate_Admin
Administrator
Administrator

Validación de valores alfanuméricos mediante DAX en Power BI

Hola

Necesito ayuda con la validación de valores mediante DAX para determinar si solo contienen valores alfanuméricos .

Si el valor contiene solo valores alfanuméricos , debe devolver TRUE; de lo contrario, debería devolver FALSE.

Valor
gtest@gmail.com
16546854
464213
1641654
564646
646464
546498
46464
64646464
646486
64646546
ASW4646464
AW54646
AQ464654
AD446464
AS4646DD
ASDSWSD
KLHH
OOOOOOOO
POJPOJP
3 REPLIES 3
Syndicate_Admin
Administrator
Administrator

@InsightSeeker

Puede crear una columna calculada en la tabla como se muestra a continuación. ¡Siéntase libre de ajustar la fórmula o hacer más preguntas!

Verificación alfanumérica =
VAR CurrentValue = 'TuTabla'[TuColumna]
VAR Longitud = SOLAMENTE(Valor actual)
VAR CheckChar =
SUMX(
GENERATESERIES(1, Longitud),
VAR CurrentChar = MEDIO(CurrentValue, [Valor], 1)
DEVOLUCIÓN
SI(
NO (
(UNICODE(CurrentChar) >= UNICODE("A") && UNICODE(CurrentChar) <= UNICODE("Z")) ||
(UNICODE(CurrentChar) >= UNICODE("una") && UNICODE(CurrentChar) <= UNICODE("con")) ||
(UNICODE(CurrentChar) >= UNICODE("0") && UNICODE(CurrentChar) <= UNICODE("9"))
),
1,
0
)
)
DEVOLUCIÓN
SI(CheckChar > 0, FALSO, VERDADERO)

Hola @marcelsmaglhaes

Recibo el siguiente error cuando uso la sugerencia DAX anterior

InsightSeeker_0-1722612591304.png

Saludos

Gaurav

To handle blank values in your column and prevent GENERATESERIES from crashing, you can add a check for blank values in the VAR Length declaration and handle those cases appropriately

AlphanumericCheck =
VAR CurrentValue = 'YourTable'[YourColumn]
VAR Length = LEN(CurrentValue)
VAR CheckChar =
IF(
ISBLANK(CurrentValue),
0, // No characters to check, so treat as alphanumeric
SUMX(
GENERATESERIES(1, Length),
VAR CurrentChar = MID(CurrentValue, [Value], 1)
RETURN
IF(
NOT (
(UNICODE(CurrentChar) >= UNICODE("A") && UNICODE(CurrentChar) <= UNICODE("Z")) ||
(UNICODE(CurrentChar) >= UNICODE("a") && UNICODE(CurrentChar) <= UNICODE("z")) ||
(UNICODE(CurrentChar) >= UNICODE("0") && UNICODE(CurrentChar) <= UNICODE("9"))
),
1,
0
)
)
)
RETURN
IF(CheckChar > 0, FALSE, TRUE)

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.