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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
FelipeS
New Member

INTERVALO DE HORAS DE UM DIA AO OUTRO

Olá pessoal. Estou agarrado num problema já tem uns bons dias, o que ocorre: Eu tenho um painel que monitora em tempo real a produção, utilizo as informações do banco de dados, nos turnos do dia, eu utilizo o filtro "current_day" para restringir o dia e intervalo de horas. Porém, esse filtro não funciona para os turnos da noite, visto que ele começa num dia e termina em outro. Eu preciso criar um filtro que registre de 19 às 07, e as 07:01 do dia seguinte ele pare de contar, para não acumular de um dia para o outro, visto que a ideia do painel é monitorar apenas o turno atual.

3 REPLIES 3
Anonymous
Not applicable

Hi @FelipeS ,

 

My understanding is that you want to create a slicer 'current_dayn' filters both the current day and the next day.

For example, if you select 'c', you will filter out rows from 7 p.m. to 7 a.m. the next day.

You can create a measure as a visual-level filter.

Measure = var _date=MAX('Table'[Date])
var _today=TODAY()
var _day=DAY(_date)
var _month=MONTH(_date)
var _year=YEAR(_date)
var _hour=HOUR(_date)
var _sel=SELECTEDVALUE('Table (2)'[Value])
var _day2=DAY(_today)
var _month2=MONTH(_today)
var _year2=YEAR(_today)
var _day3=DAY(_today+1)
var _month3=MONTH(_today+1)
var _year3=YEAR(_today+1)
return IF(ISFILTERED('Table (2)'[Value])&&_sel="CurrentDay",IF((_day=_day2&&_month=_month2&&_year=_year2&&_hour>=19) ||(_day=_day3&&_month=_month3&&_year=_year3&&_hour<8) ,1),1)

vstephenmsft_0-1721889701527.png

Today is 7/25/2024, so it filtered from 7/25/2024 19:00 to 7/26/2024 7:00.

vstephenmsft_1-1721889770309.png

 

 

Best Regards,

Stephen Tao

 

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

 

Olá, Stephen. Antes de qualquer coisa, agradeço a sua atenção e tempo para me ajudar. Recebi este erro quando coloquei o filtro, creio que possa ser pelo fato de na tabela onde a medida foi inserida, o valor filtrado não seja uma data (00/00/0000) e sim valor tipo numero (12345)

FelipeS_0-1721911422041.png

 

Anonymous
Not applicable

Hi @FelipeS ,

 

I don't understand Portuguese. Is it an error when you created this measure?

When was the error in the screenshot generated? The error looks like your date column is text, not the date type.

 

Best Regards,

Stephen Tao

 

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

 

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

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.