Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi Community,
I have one query.
Does anybody know how Can I have a same set or same number of values for each row.
I will explain it better with an example.
Suppose I have a column named as "KEY" in a table named as "Date".
I want to have year from 2022 to next 4 years i.e. till 2026 for each key. Like this:
I have tried doing this, But it is not working:
let
Source = Table.FromList(List.Distinct(#"Full BECF"[KEY])),
StartYear = 2022,
EndYear = 2026,
NumberofYears = EndYear-StartYear,
Years = List.Generate(
() => [i=0, year = StartYear],
each [i] < NumberofYears,
each [i=[i]+1,year = [year]+1],
each [year]
),
Converted = Table.FromList(Years,Splitter.SplitByNothing(),{"Year"},null,ExtraValues.Error),
Merged = Table.NestedJoin(Source,{"Column1"},Converted,{"Year"},"NewColumn",JoinKind.FullOuter),
Expanded = Table.ExpandTableColumn(Merged,"NewColumn",{"Year"},{"NewColumn.Year"})
in
Expanded
Can you guys help me in achieving this.
Much Much thanks in Advance.
Solved! Go to Solution.
Start with your intial table and add a custom column with this expression
= {2022..2026}
Then hit the expand button in the column header to expand that list to new rows.
Pat
Start with your intial table and add a custom column with this expression
= {2022..2026}
Then hit the expand button in the column header to expand that list to new rows.
Pat
@ppm1 Thanks a lot.
Crazy, how much time I was wasting instead of this simple code.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
70 | |
68 | |
43 | |
34 | |
26 |
User | Count |
---|---|
86 | |
50 | |
45 | |
38 | |
38 |