Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Solved! Go to Solution.
@informer
The offset 0 means the function starts processing from the first element, no off set happens hear, it repects the 1st parameter and goes on with the cycle defined in the 3rd parameter.
Check this example:
2nd Parameter = 2, it skips from the begining as the 4th Paramter is 0
2nd Parameter = 2, it skips 2 but starting from 1 as I have entered 1 as the offset paramter in the 4th parameter. I am telling to start the process after 1 (1st element)
Hope I managed to explain 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Hi @informer
As per the requirement, I have reproduced it locally on my machine and uploaded the attached .pbix file. Please try it out and let me know your understanding of the List.Alternate functionality.
Here is a detailed explanation of the List.Alternate parameters.
Function | Explanation | Result |
List.Alternate(OriginalList, 1, 1, 1) | Starts at index 1(1st element = 1), keeps 1, skips 1, and continues. | {1, 3, 5, 7, 9} |
List.Alternate(OriginalList, 1, 1, 0) | Starts at index 0(1st element = 2), keeps 1, skips 1, and continues. | {2, 4, 6, 8, 10} |
List.Alternate(OriginalList, 1, 1) | Defaults to Offset = 0(same as List.Alternate(OriginalList, 1, 1, 0)). | {2, 4, 6, 8, 10} |
If the above information helps you, please give us a Kudos and marked the reply Accept as a Solution.
Thanks,
Cheri Srikanth
Hi @informer
It's been a while since I heard back from you and I wanted to follow up. Have you had a chance to try the solutions that have been offered. If the issue has been resolved, can you mark the post as Accept as Solution.
Thanks and Regrds,
Cheri Srikanth
List.Alternate( { 1..10 }, 1, 1, 1 ) = { 1, 3, 5, 7, 9 } => Select the FIRST item of the list: Ok
List.Alternate( { 1..10 }, 1, 1, 0 ) = Equals { 2, 4, 6, 8, 10 } => So what is the ZERO ITEM ?
"offset" means to select "offset" values at the beginning. In the figure below, blue and green represents the final result.
@informer
The 4th Parameter: Specifies the offset after which the function begins skipping values.
Refer these example:
// Skips 1 value (arg 1) then returns 1 values (arg 2), start skipping from offset 0(arg 3)
List.Alternate( { 1..10 }, 1, 1, 0 ) // Equals { 2, 4, 6, 8, 10 }
// Skips 1 value (arg 1) then returns 1 values (arg 2), start skipping from offset 1(arg 3)
List.Alternate( { 1..10 }, 1, 1, 1 ) // Equals { 1, 3, 5, 7, 9 }
// Skips 1 value (arg 1) then returns 1 values (arg 2), start skipping from offset 4(arg 3)
List.Alternate( { 1..10 }, 1, 1, 4 ) // Equals { 1, 2, 3, 4, 6, 8, 10 }
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Hi, Thanks for your responses
List.Alternate( { 1..10 }, 1, 1, 1 ) = Equals { 1, 3, 5, 7, 9 }
means that the first item of the list is selected = 1
List.Alternate( { 1..10 }, 1, 1, 0 ) = { 2, 4, 6, 8, 10 }
So what is the Zero item ?
@informer
The offset 0 means the function starts processing from the first element, no off set happens hear, it repects the 1st parameter and goes on with the cycle defined in the 3rd parameter.
Check this example:
2nd Parameter = 2, it skips from the begining as the 4th Paramter is 0
2nd Parameter = 2, it skips 2 but starting from 1 as I have entered 1 as the offset paramter in the 4th parameter. I am telling to start the process after 1 (1st element)
Hope I managed to explain 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
If param4 defines that the 1rst item selected in the list for List.Alternate (1..10, 1,1,1) => output list begins with 1
But List.Alternate (1..10, 1,1) = List.Alternate (1..10, 1,1,0) what is the item 0 ?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
30 | |
26 | |
24 | |
13 | |
10 |
User | Count |
---|---|
24 | |
23 | |
18 | |
12 | |
9 |