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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
clubspec
Helper III
Helper III

columna calculada para agrupar por valor con condiciones

Hola expertos,

Quiero crear una columna calculada para agrupar en función del valor de fila con condiciones:

Días de ejemploCondiciones Si el día ?Columna esperada
-9< -77+ Early
-3-4 a -74-7 Temprano
0-3 a 3En hora
54 a 74-7 Tarde
11> 77+ Tarde

¿Hay una manera más sencilla de hacerlo? por ejemplo, dax de columna calculado sin crear una nueva tabla.

Gracias por su ayuda de antemano

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@clubspec , Crear nueva columna como

Switch( True(),
[col] < -7," 7+ Early",
[col] <-4 , " 4-7 Early",
[col] <o 3 " On Time",
[col] <o 7 " 4-7 Late",
[col] > "7+ Late"
)

Proporcione sus comentarios y consejos para nuevos videos
Tutorial Series Dax Vs SQL Direct Query PBI Consejos
Apreciamos tus Felicitaciones.

View solution in original post

CNENFRNL
Community Champion
Community Champion

Hola, @clubspec , es posible que desee probar esta expresión en una columna calculada

Check =
SWITCH (
    TRUE (),
    [Days] < -7, "7+ Early",
    -7 <= [Days] && [Days] <= -4, "4-7 Early",
    -3 <= [Days] && [Days] <= 3, "On Time",
    4 <= [Days] && [Days] <= 7, "4-7 Late",
    "7+ Late"
)

Screenshot 2020-11-09 022517.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

View solution in original post

2 REPLIES 2
CNENFRNL
Community Champion
Community Champion

Hola, @clubspec , es posible que desee probar esta expresión en una columna calculada

Check =
SWITCH (
    TRUE (),
    [Days] < -7, "7+ Early",
    -7 <= [Days] && [Days] <= -4, "4-7 Early",
    -3 <= [Days] && [Days] <= 3, "On Time",
    4 <= [Days] && [Days] <= 7, "4-7 Late",
    "7+ Late"
)

Screenshot 2020-11-09 022517.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

amitchandak
Super User
Super User

@clubspec , Crear nueva columna como

Switch( True(),
[col] < -7," 7+ Early",
[col] <-4 , " 4-7 Early",
[col] <o 3 " On Time",
[col] <o 7 " 4-7 Late",
[col] > "7+ Late"
)

Proporcione sus comentarios y consejos para nuevos videos
Tutorial Series Dax Vs SQL Direct Query PBI Consejos
Apreciamos tus Felicitaciones.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors