March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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.
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)
Today is 7/25/2024, so it filtered from 7/25/2024 19:00 to 7/26/2024 7:00.
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)
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
87 | |
85 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |