Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
hi, I have this to give an accumultion and re start at each text value so { "A", 2,3,3,"b","c", 3,4,5,"c",2,3, = "A",2,5,8,"b","c",3,7,12
etc.
let
alist = {"A",2,3,3,"a","b",2,3,3,2,"c",3,2,3,2,3}
in
List.Generate(
()=> [x = 0 ,y = alist{0} , z = y] ,
each [x] < List.Count( alist) ,
each [ x = [x] + 1, y = alist{x} , z = try [z] + y otherwise alist{x} ],
each [z]
)
Coult this be written without try / otherwise and still using generate not accumulate or some other.
Richard.
Solved! Go to Solution.
For your z function, you could check for the type instead:
if y is number and [z] is number then [z] + y else y
Thnks, id used Value.Is in skipping over the text so don't know why I never thought of this.
For your z function, you could check for the type instead:
if y is number and [z] is number then [z] + y else y
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 |
---|---|
15 | |
10 | |
10 | |
8 | |
7 |