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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
cfurminger
Frequent Visitor

HELP Counting the Amount of Date Periods Per Sales Order

Hi, 

 

Need some help with this. 

 

I need a running total for the amount of instances in each Sales Order, in my example I have highlighted the 3 main varaibles. 

 

(Sales Orders, Date of Change and my Solution)

 

However my solution is only giving me the amount of lines in each Sales Order. 

 

My answer for 2 lines = 2,2 and for 3 lines = 3,3,3.

 

Number of orders per Orders = COUNTX (
FILTER ( 'System Note Dataset COREY TEST (2)', EARLIER('System Note Dataset COREY TEST (2)'[Record] ) = 'System Note Dataset COREY TEST (2)'[Record]),
'System Note Dataset COREY TEST (2)'[Record]
)

But I want it to start at 1 and count the amount of lines per Sales Order. 

 

2 lines = 1,2 and for 3 lines = 1,2,3 etc. etc. 

 

cfurminger_0-1674462151545.png

 

Any help would be amazing!

 

Corey

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @cfurminger 

 

You can try this DAX:

Number of orders per Orders = COUNTX (
FILTER ( 'System Note Dataset COREY TEST (2)', EARLIER('System Note Dataset COREY TEST (2)'[Record] ) = 'System Note Dataset COREY TEST (2)'[Record] && EARLIER('System Note Dataset COREY TEST (2)'[Date]) >= 'System Note Dataset COREY TEST (2)'[Date] ),
'System Note Dataset COREY TEST (2)'[Record]
)

vjingzhang_0-1674615498200.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

2 REPLIES 2
v-jingzhang
Community Support
Community Support

Hi @cfurminger 

 

You can try this DAX:

Number of orders per Orders = COUNTX (
FILTER ( 'System Note Dataset COREY TEST (2)', EARLIER('System Note Dataset COREY TEST (2)'[Record] ) = 'System Note Dataset COREY TEST (2)'[Record] && EARLIER('System Note Dataset COREY TEST (2)'[Date]) >= 'System Note Dataset COREY TEST (2)'[Date] ),
'System Note Dataset COREY TEST (2)'[Record]
)

vjingzhang_0-1674615498200.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

cfurminger
Frequent Visitor

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.