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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
CastroRibeiro
Helper I
Helper I

Creating a gant chart using a matrix and how to create an event rank

I'm creating a gant chart using a matrix, because I need a certain customization...

 

I'm trying to find a solution for when events have a start and end date on the same day, that is, when they are conflicting

I thought of creating a ranking of the events that are most important.

In my case, if I were to create a rank based on the switch function (code below), it would look like this, in order of importance:

First: 1.8 12.11
Second: 2, 3, 10
Third:6
Room:3
Fifth:5,9,13

 

Today I use conditional customization to fill the cells with colors

Is this the best idea? Is there any better and how can I do it?

 

biDisponibilidade.png

My code:

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

March Power BI Update Carousel

Power BI Community Update - March 2026

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