cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Make measure including future date

I need to create a measure that calculates the amount of id_avaliacao where the status = "Reprovado" taking into account 5 days after the page filter.
Example: filter data_conclusao 2023-01-01 to 2023-01-01. Measure result: 6

 

id_avaliacaodata_conclusaostatus
634968862023-01-03Reprovado
634977052023-01-04Reprovado
634977022023-01-04Reprovado
634976492023-01-04Reprovado
634982122023-01-05Reprovado
634979682023-01-05Reprovado
634979972023-01-06Reprovado
634979892023-01-06Reprovado
634980062023-01-06Reprovado






2 ACCEPTED SOLUTIONS
tamerj1
Super User
Super User

Hi @Anonymous 

Please try

Measur =
VAR CurrentDate =
MAX ( 'Table'[data_conclusao] )
RETURN
COUNTROWS (
FILTER (
ALL ( 'Table' ),
'Table'[Status] = "Reprovado"
&& 'Table'[data_conclusao] > CurrentDate
&& 'Table'[data_conclusao] <= CurrentDate + 5
)
)

View solution in original post

@Anonymous 

Please try

Measure =
VAR MinDate =
MIN ( 'Table'[data_conclusao] )
VAR MaxDate =
MAX ( 'Table'[data_conclusao] )
RETURN
COUNTROWS (
FILTER (
ALL ( 'Table' ),
'Table'[Status] = "Reprovado"
&& 'Table'[data_conclusao] > MinDate
&& 'Table'[data_conclusao] <= MaxDate + 4
)
)

View solution in original post

4 REPLIES 4
devanshi
Helper V
Helper V

filterpage=
VAR maxdate = MAX(data-conclusao)
RETURN

COUNTROWS(FILTER('Tablename',[status]='Reprovado',
AND('Table'[data-conclusao]>maxdate,'Table'[data-conclusao]<=maxdate+5)))

tamerj1
Super User
Super User

Hi @Anonymous 

Please try

Measur =
VAR CurrentDate =
MAX ( 'Table'[data_conclusao] )
RETURN
COUNTROWS (
FILTER (
ALL ( 'Table' ),
'Table'[Status] = "Reprovado"
&& 'Table'[data_conclusao] > CurrentDate
&& 'Table'[data_conclusao] <= CurrentDate + 5
)
)

@Anonymous 

Please try

Measure =
VAR MinDate =
MIN ( 'Table'[data_conclusao] )
VAR MaxDate =
MAX ( 'Table'[data_conclusao] )
RETURN
COUNTROWS (
FILTER (
ALL ( 'Table' ),
'Table'[Status] = "Reprovado"
&& 'Table'[data_conclusao] > MinDate
&& 'Table'[data_conclusao] <= MaxDate + 4
)
)

Anonymous
Not applicable

Hi @tamerj1 
Did not work.
When I filter by date 2023-01-01 to 2023-01-01, the measurement result is 9.
When filtered by date 2023-01-01 to 2023-01-05, the measurement result is 3.

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Top Solution Authors
Top Kudoed Authors