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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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