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
Anonymous
Not applicable

Get Latest Date having sales greater than 1

I am looking for dax to get Latest Date having sales. 

 

Dax should get last date having sales amount greater than 1. 

 

 

Example 1:

data           Sales    Output 

1/4/2021               1/2/2021

1/3/2021

1/2/2021    2

1/1/2021    4

 

Example 2:

data           Sales    Output 

3/4/2021               2/2/2021

2/3/2021

2/2/2021    2

2/1/2021    4

 

 

1 ACCEPTED SOLUTION

@Anonymous , sorry, try like

calculate(max(Date[Date]),filter(allselected(Table), Table[Sales] >1))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@Anonymous , Try a measure like

 

maxx(filter(allselected(Table), Table[Sales] >1), Table[Date])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

I have Date in differnt dimention table and sales count in fact table. this dax will not helping. 

 

I am getting this below error:

Too few arguments were passed to the IF function. The minimum argument count for the function is 2.

@Anonymous , if you date table

maxx(filter(allselected(Table), Table[Sales] >1), Date[Date])

 

But where is if ?

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

abhilashpatel_1-1614837038823.png

 

Error as below.

A single value for column 'Date' in table 'DIM Date' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.

 

This no If statment in it. Please see the above screen shot. Date is differnt table and sales in differnet table.

@Anonymous , sorry, try like

calculate(max(Date[Date]),filter(allselected(Table), Table[Sales] >1))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.