Reputation: 117
I can't get Power BI to filter by last date in file.
When I try:
test = CALCULATE(
DISTINCT(table[Date]),
filter(
all(table[Date]),
table[Date] = date(2019,3,1)
)
)
It returns me the date March 1, 2019.
But if I use
test = CALCULATE(
DISTINCT(tabela_ajustada[Data]),
filter(
all(tabela_ajustada[Data]),
tabela_ajustada[Data] = LASTDATE(tabela_ajustada[Data])
)
)
It won't work, it's not filtering at all, so I get an error because it returns multiple values and I can't add to the card.
table[Date] has multiple non unique values.
Upvotes: 0
Views: 105
Reputation: 7891
Change to:
test =
CALCULATE(
DISTINCT(tabela_ajustada[Data]),
FILTER(
ALL(tabela_ajustada[Data]),
tabela_ajustada[Data] = LASTDATE ( ALL ( tabela_ajustada[Data] ) )
)
)
Upvotes: 1