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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Caio_Volpe
New Member

Como colocar horários de um dia no eixo x de um gráfico?

Boa tarde,

Já pesquisei bastante na internet de não achei uma solução ainda.

Tenho um controle em excel do uso das salas de reuniões, onde tenho colunas de data, solicitante, horário de início e horário de fim.

Preciso saber a ociosidade das salas em um dia e em cada horário do dia.

Até consegui fazer um gráfico de rosca considerando a ociosidade do dia em porcentagem em relação ao horário comercial disponível do dia.

Porém, meu problema é saber em momentos do dia, ou seja, como exemplo uma sala em um dia específico pode estar em uso de 08:00 às 10:00, fica vazia de 10:00 às 14:00 e depois fica ocupada novamente até 20:00. Logo, como fazer um gráfico no Power Bi que mostre a utilização? Minha ideia inicial para resolver esse problema é no excel criar uma nova coluna onde eu digo se for 08:00 da manhã, na coluna início da reunião, preencherá o número "1", se for 08:15 o número "2", e assim vai de 15 em 15 minutos. Sendo assim, consigo colocar no eixo x o horário de 08:00 até 20:00. Contudo, o problema que não consigo fazer com que nesse exemplo de 08:00 às 10:00 marque no gráfico as opções: 08:00, 08:15, 08:30, 08:45, 09:00, 09:15, 09:30 e 09:45 .

Alguém consegue me ajudar?
Obrigado

 

1 ACCEPTED SOLUTION
v-chenwuz-msft
Community Support
Community Support

Hi @Caio_Volpe

 

Is this you want ?

vchenwuzmsft_0-1662433595654.png

 

If i am right, please create a x-axis table first via 

x-axis = GENERATESERIES(TIME(8,0,0),TIME(21,59,59),TIME(0,15,0))
 
which returns table like below:
vchenwuzmsft_1-1662433705344.png
 
Then create a measure to draw the line chart or bar chart.
measure =
countrows( filter ( table , [start time] <= max('x-axis'[value] ) && [end time] >= max('x-axis'[value] )) )

Best Regards

 

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
v-chenwuz-msft
Community Support
Community Support

Hi @Caio_Volpe

 

Is this you want ?

vchenwuzmsft_0-1662433595654.png

 

If i am right, please create a x-axis table first via 

x-axis = GENERATESERIES(TIME(8,0,0),TIME(21,59,59),TIME(0,15,0))
 
which returns table like below:
vchenwuzmsft_1-1662433705344.png
 
Then create a measure to draw the line chart or bar chart.
measure =
countrows( filter ( table , [start time] <= max('x-axis'[value] ) && [end time] >= max('x-axis'[value] )) )

Best Regards

 

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Good Morning @v-chenwuz-msft ,

I did it with your help.

I have been trying for a long time to solve this.

Thank you very much.

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.