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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
alexanderg
Advocate II
Advocate II

DAX - Display in a chart any expression only for the Max Date

How can I show a sales or any expression in a chart only for the maximum date. For example I have the following dataset:

Dataset.JPG

I created the following calculation in DAX:

SalesMaxday =
CALCULATE (
    SUM ( Tabla1[SaleAmount] ),
    FILTER ( Tabla1, Tabla1[Date] = MAX ( Tabla1[Date] ) )
)

 

This is the result I get:

 

Resultado.JPG

So... As it is seen, as an individual calculation shows me the desirable result. But in the table chart, It shows not only the value of the maximum date, but also the rest of dates. How can I do to not show those other values, applying the filter internally in the DAX formula, because I wanna see in the table chart only the result for the max date.

 

Any Reply would be helpful

 

Regards,

6 REPLIES 6
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi alexanderg,

 

To display the max date record only, please modify your measure expression like :


SalesMaxday =

CALCULATE ( SUM ( Tabla1[SaleAmount] ), FILTER ( Tabla1, Tabla1[Date] = Maxx(ALL (Table1[Date]), Table1[Date])

 

If you have any question, please feel free to ask.

 

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yulgu-msft Your Measure works fine but only for the maximun day in the complete dataset. It need to be based dinamically on the current single selection for month or Year Slicers i.e. the maximun day for the selected month or selected year.

 

Regards,

Hi @v-yulgu-msft Thanks!!

 

Your Expression Works Fine!! Can you give me a feedback about how that Measure works? 

 

Thank you very much!!

samdthompson
Memorable Member
Memorable Member

Hi, I am assuming you are wanting the most recent day? If so, put a calculated column on your date filter which is something like:

 

MAXDAY=IF(date[calendar_date] = MAX(date[caldendar_date]), 1 , 0)

 

Then use that column as a filter to your visual. If your calendar is dynamically linked to say a range up to today then maybe use:

 

MAXDAY=IF(date[calendar_date] = TODAY()-1, 1, 0)

// if this is a solution please mark as such. Kudos always appreciated.

Hi @samdthompson Thanks for your reply,

 

I want to display in the chart, any expression only for the most recent day in the dataset considering dinamically the actual filters in the slicer, so not necessarily be this day, For example: suppose you have a dataset with values for periods of April, May and June. If I apply filter on a slicer for the month of April in the chart I want to see only the results associated of the maximum date of April. It must be the same behavior if another different month is selected. So the issue is: in the chart the total is the correct total associated with the maximum date, but the problem is that it shows me the results of the measure for the rest of the days that are not associated with the maximum date.

 

 

right. thats quite a different thing. have a read of this page. some frankenstiening of the solution used there will fix your problem:

 

http://community.powerbi.com/t5/Desktop/Dynamic-Line-and-Bar-Chart/m-p/39026#M14518

// if this is a solution please mark as such. Kudos always appreciated.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors