Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi,
I have a data set where I want to count the number of Loss or wins in a row, but reset each time it switches to the new name like this:
Win | 1 |
Win | 2 |
Win | 3 |
Loss | 1 |
Loss | 2 |
Win | 1 |
Win | 2 |
The Trade UID is the main index for this table that is unique.
Any guidance on how to do this would be great, I've tried quite a few different things and the closest I can get it to create a running count, but can't get it to reset.
A sample of the dataset can be found here: https://1drv.ms/u/s!Ag_sNauqdCgpg95oGmGBlk9NJrf0Uw?e=hICHI1
Thanks
Solved! Go to Solution.
PQ and Excel formula are way much conciser and more straightforward,
Grouped = Table.RemoveColumns(Table.Group(Source, "PnL Text", {"ar", each Table.AddIndexColumn(_, "Streak_PQ", 1)}, 0), "PnL Text")
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! |
This worked a treat, I used the PQ version in the end. Thanks for quick help.
PQ and Excel formula are way much conciser and more straightforward,
Grouped = Table.RemoveColumns(Table.Group(Source, "PnL Text", {"ar", each Table.AddIndexColumn(_, "Streak_PQ", 1)}, 0), "PnL Text")
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! |
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
10 | |
10 | |
9 | |
7 |
User | Count |
---|---|
17 | |
12 | |
11 | |
11 | |
11 |