cancel
Showing results for
Did you mean:

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Helper III

## Card last date

Hello friends,

I need to do a card (measure), which updates every day with the current date independent to have a date filter on report.

in short, I need to make a measure with the last date and that is not dependent on a filter in the report.

Can someone help me?

Thanks a lot!

1 ACCEPTED SOLUTION
Super User

@vinicius_ramos Hence why I did not recommend having MAX in your CALCULATE and instead use a separate measure. You can also do this:

Total Defeito =
VAR __Max = MAX(Log_Bateria[Data])
RETURN
calculate(
DISTINCTCOUNT(Log_Bateria[Equipamentos]),Log_Bateria[Status1] = "Com Defeito",
Log_Bateria[Data] = __Max) + 0

Become an expert!: Enterprise DNA
External Tools: MSHGQM
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...
6 REPLIES 6
Super User

@vinicius_ramos You can use TODAY() or MAXX(ALL('Table'),[Date])

Become an expert!: Enterprise DNA
External Tools: MSHGQM
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...
Helper III

Hello, @Greg_Deckler

I have this measure:

Total Defeito = CALCULATE(
DISTINCTCOUNT(Log_Bateria[Equipamentos]),Log_Bateria[Status1] = "Com Defeito") + 0.

Where i include MAXX(ALL('Table'),[Date]) in this case?
Super User

@vinicius_ramos Just create a new measure with that formula. Then you could adjust your formula to be something like:

Total Defeito = CALCULATE(
DISTINCTCOUNT(Log_Bateria[Equipamentos]),Log_Bateria[Status1] = "Com Defeito", 'Table'[Date]=[Max date measure]) + 0

Become an expert!: Enterprise DNA
External Tools: MSHGQM
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...
Helper III

My data table is " Log_bateria[Data]"

I used :

Total Defeito = calculate(
DISTINCTCOUNT(Log_Bateria[Equipamentos]),Log_Bateria[Status1] = "Com Defeito",
Log_Bateria[Data] = MAX(Log_Bateria[Data])) + 0

and return to me: A 'MAX' function was used in a True/False expression used as a table filter expression. This is not allowed.

Do you can help me?
Super User

@vinicius_ramos Hence why I did not recommend having MAX in your CALCULATE and instead use a separate measure. You can also do this:

Total Defeito =
VAR __Max = MAX(Log_Bateria[Data])
RETURN
calculate(
DISTINCTCOUNT(Log_Bateria[Equipamentos]),Log_Bateria[Status1] = "Com Defeito",
Log_Bateria[Data] = __Max) + 0

Become an expert!: Enterprise DNA
External Tools: MSHGQM
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...
Helper III

Hello, @Greg_Deckler

It's work.

Thanks a lot !!!

Announcements

#### Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

#### Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

#### The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors