Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Ramh84
Frequent Visitor

Recurrence Problem in Power BI

Good day everyone,

I am facing some techinical difficulities to move from the input table below, to the desired table.

My goal is to print the recurrence of the each Merged item (Merged Header) as of the selected date in the BI report.

For example, 

Ramh84_0-1724936437733.png

If I am selecting a specific date at whcih the Merged item is available e.g., 5-Feb, Marry, A1, 14548, I should have the recurrence

showing 2. In other means the power query should give me the the recurrence of Marry, A1, 14548 since the begining of the year untill the selected date(if such record(Merged header) falls on that day.  

 

The reason that I am having a second merged header that includes the Date is because I am intending to link the recurrence header with another table that will have the same Merged.1 header in there. 
Here you can find the excel sheet 
Test file

 

I will really appreciate your help in solving this buzzle 🙂

 

 

 

Input

 

Ramh84_1-1724937269302.png

 

 

Desired output

 

 

Ramh84_0-1724937245669.png

 

1 ACCEPTED SOLUTION
jgeddes
Super User
Super User

You can group by 'Merged', choose 'all rows' and then add an index column starting at one for each nested table. Expand the nested tables with the index column and you will have your result.
Example:

jgeddes_0-1724940232989.pngjgeddes_1-1724940248573.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclSK1YGRThikMxLpohQbCwA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"Column1"}, {{"nestedTables", each _, type table [Column1=nullable text]}}),
    Custom1 = Table.TransformColumns(#"Grouped Rows", {{"nestedTables", each Table.AddIndexColumn(_, "Recurrence", 1, 1, Int64.Type)}}),
    #"Expanded nestedTables" = Table.ExpandTableColumn(Custom1, "nestedTables", {"Recurrence"}, {"Recurrence"})
in
    #"Expanded nestedTables"




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

2 REPLIES 2
Ramh84
Frequent Visitor

Really really appreciated your great support!

 

It worked 100%!

All what I needed to do before applying the changes in my actual BI file is to delete the Merged column after creating another one that is a result from merging the merged column with the date to have no duplicate records in the table. 

jgeddes
Super User
Super User

You can group by 'Merged', choose 'all rows' and then add an index column starting at one for each nested table. Expand the nested tables with the index column and you will have your result.
Example:

jgeddes_0-1724940232989.pngjgeddes_1-1724940248573.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclSK1YGRThikMxLpohQbCwA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"Column1"}, {{"nestedTables", each _, type table [Column1=nullable text]}}),
    Custom1 = Table.TransformColumns(#"Grouped Rows", {{"nestedTables", each Table.AddIndexColumn(_, "Recurrence", 1, 1, Int64.Type)}}),
    #"Expanded nestedTables" = Table.ExpandTableColumn(Custom1, "nestedTables", {"Recurrence"}, {"Recurrence"})
in
    #"Expanded nestedTables"




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.