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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

Count number of consecutive values and sequence

Hi all, 

 

Hopefully someone can point me in the right direction. 

 

I am looking to count the number of occurrences of consecutive point won within a tennis match. I would like to count how many times a player wins just 1 point, 2 points in a row, 3 points in a row, etc. 

 

For example:

 

Point won by

Player A

Player B

Player B

Player A

Player B

Player B

Player B

 

Here player A has won 1 point 2 times

Player B has won 2 points in a row once, and also 3 points in a row once. 

 

I would like to have a measure for each sequence values (ie a measure for how many times player A wins 1 point in a row, another measure for when player A wins 2 points in a row, another for how many times they win 3 points in a row, etc.

 

I suspect I will need to use EARLIER function and an index column but not sure how to put it all together.

 

Any help would be much appreciated. 

 

Thanks 

 

Marc

2 ACCEPTED SOLUTIONS
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the picture down below and the attached pbix file.

All steps of measures are written down in the attached file.

 

Picture1.png

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

View solution in original post

CNENFRNL
Community Champion
Community Champion

CNENFRNL_0-1645987410723.png

Excel worksheet formula is powerful enough to deal with this simple quesiton

CNENFRNL_2-1645987861581.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

View solution in original post

3 REPLIES 3
CNENFRNL
Community Champion
Community Champion

CNENFRNL_0-1645987410723.png

Excel worksheet formula is powerful enough to deal with this simple quesiton

CNENFRNL_2-1645987861581.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the picture down below and the attached pbix file.

All steps of measures are written down in the attached file.

 

Picture1.png

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Anonymous
Not applicable

Hi @Jihwan_Kim and @CNENFRNL

Thank you both for your replies.... They both work great! I will now look to see if I can fully understand the workings of each solution 😊

 

Thanks again it's much appreciated 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.