March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi together;
I would like to create a costum column C in power querry which counts the consecutive negative numbers in Column B.
Which forml needs to be put in here:
to achive the following goal (result in column c)
B | C |
8 | 0 |
5 | 0 |
-5 | 3 |
-47 | 3 |
-4 | 3 |
1 | 0 |
5 | 0 |
Thanks and regards
Pete
Dear @v-jialongy-msft ,
thanks for the quick reply; unfortunatly i get an error saying can not be converted into a list:
my table and datatypes are the following:
Any idea how to solve that?
Cheers, Pete
Hi @Pete230
First, add an index column in power query.
Then use the following code to add a custom column:
let
CurrentRow = [Index],
ListNegative = List.LastN(
List.FirstN(Source[B], CurrentRow+1),
each Number.FromText(_) < 0
)
in
List.Count(ListNegative)
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-jialongy-msft ; do you have any advice for that issue too?
That would be very much appreciated 🙂
Cheers, Pete
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
114 | |
76 | |
57 | |
52 | |
44 |
User | Count |
---|---|
165 | |
116 | |
63 | |
57 | |
50 |