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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Dax formulas

i want to find count of each product not received orders after last received order date. i tried some dax formulas, but it doesn't work.
 
Not received orders after last received order =
VAR order_date = VALUES(Sheet1[Order date])
VAR lasorderdate = CALCULATE(LASTDATE(order_date),Sheet1[Received order]>0)
VAR after_lastorder = CALCULATE(COUNTROWS(Sheet1),Sheet1[Order date]<lasorderdate)
return after_lastorder
5 REPLIES 5
v-jianboli-msft
Community Support
Community Support

Hi @Anonymous ,

 

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or if you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

 

Refer to:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

answer:

Measure =
VAR lasorderdate = CALCULATE(MAXX(Sheet1,Sheet1[Order date]),Sheet1[Received order]>0)
VAR after_lastorder = CALCULATE(COUNTROWS(Sheet1),Sheet1[Order date]<lasorderdate,Sheet1[Received order]=0)
return after_lastorder
FreemanZ
Super User
Super User

LASTDATE returns a table, try to replace it with MAX

Anonymous
Not applicable

when i use max then happened: the max function only accepts a column reference as an argument.

can you paste your code?

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.