new here. I have a basic excel I import in power BI. With 2 columns. Dates and results. The result is either good or bad. I built a function where it checks how many (work) days are good since the last bad day. While I have 2 function that works, I want to know why one doesn't work. This one doesn''t work:
>Measure =
CALCULATE (
COUNT ( Table[Date] )
,Table[Result] = "Good"
,FILTER (
Table
,Table[Date] > CALCULATE (
MAX ( Table[Date] )
,Table[Result] = "bad"
)
)
) + 0
This apparently counts every good days and doesn't filter out since last bad one.
These work:
>Measure =
CALCULATE (
COUNT ( Table[Date] )
,Table[Result] = "Good"
,FILTER (
Table
,Table[Date]> CALCULATE(
MAX (Table[Date])
,Table
,Table[Result] = "bad"
)
)
) + 0
>Measure =
CALCULATE (
COUNT ( Table[Date] )
,Table[Result] = "Good"
,FILTER(
Table
,Table[Date]> CALCULATE(
MAX(Table[Date])
,FILTER(
Table
,Table[Result] = "bad"
)
)
)
) + 0
Can someone explain what the first one does "wrong"? Thanks in advance!