Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
David_Gonzalez
New Member

Measure dax filter date

I want to make a measure with filter but dont works:

Measure 1:  Max_Fecha = LASTDATE(loans[F_VALOR])
Measure final:   Spot1 = calculate(sum(loans[M_SALDO_AVG_DISPONIBLE_USD]), filter (loans, loans[F_VALOR] = [Max_Fecha]))
 
The result is the grand total and no filter nothing
1 ACCEPTED SOLUTION

Hi,

As long as the Calendar table has been created using the CALENDAR() function, the formula should always return the value of the last date in the Calendar Table (which in turn should pick up the last date from the Data Table).

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Create a Calendar Table with a relationship (Many to One and Single) from the F_Valor column to the Date column of the Calendar Table.  Try this measure

Spot1 = CALCULATE(sum(loans[M_SALDO_AVG_DISPONIBLE_USD]),LASTNONBLANK('Calendar'[Date],
CALCULATE(sum(loans[M_SALDO_AVG_DISPONIBLE_USD]))))
Hope this helps.

Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thx Ashish, I have the calendar table, and his measure works, but How can I add the filter the MaxDate? this is beacuse daily the data update wiht the previous date .

Hi,

As long as the Calendar table has been created using the CALENDAR() function, the formula should always return the value of the last date in the Calendar Table (which in turn should pick up the last date from the Data Table).

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.