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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Syndicate_Admin
Administrator
Administrator

Crear un diagrama de gant usando una matriz y cómo crear un rango de eventos

Estoy creando un diagrama de gant usando una matriz, porque necesito una cierta personalización...

Estoy tratando de encontrar una solución para cuando los eventos tienen una fecha de inicio y finalización el mismo día, es decir, cuando son conflictivos.

Pensé en crear un ranking de los eventos que son más importantes.

En mi caso, si tuviera que crear un rango basado en la función switch (código a continuación), se vería así, en orden de importancia:

Primero: 1.8 12.11
Segundo: 2, 3, 10
Tercera:6
Habitación:3
Quinto:5,9,13

Hoy uso la personalización condicional para llenar las celdas con colores

¿Es esta la mejor idea? ¿Hay algo mejor y cómo puedo hacerlo?

biDisponibilidade.png

Mi código:

Periodo = 
var _startDate = 
    CALCULATE(
        MIN('TBL_DISPONIBILIDADE_FROTA_AEREA'[MARCO_INICIAL]),
        ALL(CUSTOM_CALENDARIO)
    )
var _endDate = 
    CALCULATE(
        MAX('TBL_DISPONIBILIDADE_FROTA_AEREA'[MARCO_FINAL]),
        ALL(CUSTOM_CALENDARIO)
    )
var _period = 
    MIN(CUSTOM_CALENDARIO[Data])>= _startDate
    && MAX(CUSTOM_CALENDARIO[Data]) <= _endDate

var _status = 
    CALCULATE(
        MAX(TBL_DISPONIBILIDADE_FROTA_AEREA[STATUS]),
         ALL(CUSTOM_CALENDARIO)
    )


RETURN
SWITCH(
    TRUE()
    ,_period && _status = "INDISPONÍVEL",1
    ,_period && _status = "PREVISTO",2
    ,_period &&  _status = "PRONTO COMUNICADO",3
    ,_period &&  _status = "PRONTO NÃO VALIDADO",4
    ,_period &&  _status = "ENCERRADO",5
    ,_period && _status = "FRANQUIA SOLICITADA",6
    ,_period && _status = "FRANQUIA AUTORIZADA",7
    ,_period && _status = "FRANQUIA EM CURSO",8
    ,_period && _status = "FRANQUIA ENCERRADA",9
    ,_period && _status = "ACC AGENDADO",10
    ,_period && _status = "ACC EM CURSO",11
    ,_period && _status = "ACC ENCERRADO",12 
    )

0 REPLIES 0

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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

Top Solution Authors