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
lopezSevilla
New Member

AGRUPAR TRAMOS DE DIAS

Hola, tengo un problema a ver como se puede solucionar.

Tengo un campo llamado DiferenciaDias y necesito crear un campo nuevo en el que los valores sean "menor de 15 dias" "Entre 16 y 30 dias" etc

Esta funcionalidad la he conseguido hacer a través de Excel y su formula correspondiente poniéndole la Y detrás del IF pero desconozco en lenguaje DAX cual sería su equivalente.

Gracias

1 ACCEPTED SOLUTION
bestevez
Helper I
Helper I

La verdad es que no sé si la comunidad habla español, pero bueno, yo si e intentaré ayudarte.

 

Puedes utilizar la función SWITCH

 

Measure = 

 

SWITCH ( TRUE();

DiferenciaDias <= 15; "Menor de 15 dias";

DiferenciaDias > 15; "Entre 16 y 30 dias;

BLANK()

)

 

Si por ejemplo quiere añadir un AND

Measure = 

 

SWITCH ( TRUE();

AND( DiferenciaDias >0 ; DiferenciaDias <= 15; "Menor de 15 dias";

DiferenciaDias > 15; "Entre 16 y 30 dias;

BLANK()

)

 

No sé si esto te sirve. Saludos

View solution in original post

1 REPLY 1
bestevez
Helper I
Helper I

La verdad es que no sé si la comunidad habla español, pero bueno, yo si e intentaré ayudarte.

 

Puedes utilizar la función SWITCH

 

Measure = 

 

SWITCH ( TRUE();

DiferenciaDias <= 15; "Menor de 15 dias";

DiferenciaDias > 15; "Entre 16 y 30 dias;

BLANK()

)

 

Si por ejemplo quiere añadir un AND

Measure = 

 

SWITCH ( TRUE();

AND( DiferenciaDias >0 ; DiferenciaDias <= 15; "Menor de 15 dias";

DiferenciaDias > 15; "Entre 16 y 30 dias;

BLANK()

)

 

No sé si esto te sirve. Saludos

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.

Top Solution Authors