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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
BoyerAlexis
Frequent Visitor

Retrieve data in .each() and create columns

Hi,

 

I'm kind of a begginer in PowerBI and I'm facing an issue :

 

I've got an existing table with datas in it, being updated every month by someone else.

In this table I've got colums named MonthCode, OperationalBase, Action like so :

 

5, Dijon, 6

5, Nevers, 2

5, Beaune, 9

6, Dijon, 5

6, Nevers, 8

 

In this example, I've got no data for Beaune in the month of June and I'd like it "write itself".

By that, I means that whenever a new month is detected (7 for this example), every city will be here no matter what, even if no data was inserted.

 

I'm trying to create something in the Power Query editor but I've got no bases.

Here's what I got right now :

 

 

 Test = List.Generate(
    ()=>0,
    each _<12, each _+1,
// check if _ exists in DataTable
    each Table.Column(
            [monthCode = _+1, city = "Dijon", action = DataTable['action']['Dijon']]
            [monthCode = _+1, city = "Nevers", action = DataTable['action']['Nevers']]
            [monthCode = _+1, city = "Beaune", action = DataTable['action']['Beaune']]
// maybe automatically create the rows without adding them manually to the code ??
        )
    ),

 

 

I'm not even sure if what i'm asking is possible, but I'd be grateful if you could help me.

1 REPLY 1
AlB
Community Champion
Community Champion

Hi @BoyerAlexis 

Can you provide the expected output for the table you have shown, with an accompanying explanation. I do not quite understand what you need. Also, you talk about a new month being detected "7 for this example" but I see no 7 on the input data

 

 

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.