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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register 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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.