Last active
May 21, 2023 15:43
-
-
Save Hugoberry/6cf0ef9c2c1e3112261b359903dbd857 to your computer and use it in GitHub Desktop.
Prerequisites for drawing Homer Simpson in Power BI. The Power Query code for the iterator table [ranges]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let | |
//generate a range between [start] and [end] in number of [steps] with a category descriptor | |
range = (category,steps,start,end)=>List.Accumulate({1..steps},{{category,start}},(s,c)=>s&{{category,start+(c/steps)*(end-start)}}), | |
//shortcut | |
pi = Number.PI | |
//stiching multiple ranges into a an iterator table | |
in #table(type table[#"fn"=number,#"i"=number], | |
range(0,20,35*pi,36*pi)& | |
range(1,10,31*pi,32*pi)& | |
range(2,10,27*pi,28*pi)& | |
range(3,30,23*pi,24*pi)& | |
range(4,30,19*pi,20*pi)& | |
range(5,30,15*pi,17*pi)& | |
range(6,30,11*pi,13*pi)& | |
range(7,30,7*pi,9*pi)& | |
range(8,30,3*pi,5*pi)& | |
range(9,30,1*pi,3*pi)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Would you be able to share the PBIX file? I have an issue with PQ implementation of that code?