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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
JackWren
Helper II
Helper II

Bulk Upload metadata tables | C# Tabular Editor

Hi, 

 

I have a csv file that contains two columns: tableName and description (that contains the table descriptions)

I'm trying to bulk update my table descriptions. This runs in Tabular but it doesn't load in the dataset. 

using System;
using System.IO;
using System.Linq;

// Define the path to the CSV file
var csvFilePath = @"<ANONYMIZED_PATH>\TableInfo_Test.csv";

// Check if the file exists
if (!File.Exists(csvFilePath))
{
    throw new FileNotFoundException("The specified CSV file was not found.", csvFilePath);
}

// Read all lines from the CSV file
var lines = File.ReadAllLines(csvFilePath);

// Skip the header and parse the CSV file
foreach (var line in lines.Skip(1))
{
    var parts = line.Split(';');

    // Check if the line has at least two parts
    if (parts.Length < 2)
    {
        Console.WriteLine("Skipping line due to insufficient parts: " + line);
        continue; // Skip this line if it doesn't have enough parts
    }

    var tableName = parts[0].Trim();
    var description = parts[1].Trim();

    // Find the table in the model
    var table = Model.Tables.FirstOrDefault(t => t.Name.Equals(tableName, StringComparison.OrdinalIgnoreCase));
    if (table != null)
    {
        Console.WriteLine("Updating table: " + tableName);
        table.Description = description;
    }
    else
    {
        Console.WriteLine("Table not found: " + tableName);
    }
}

 

Did anyone find a solution or something else to do this? 

 

Thank you

 

3 REPLIES 3
JackWren
Helper II
Helper II

From what we have found, it doesn't seem possible to use C# for the table descriptions. Thank you for the other option, I'll have to investigate some more. 

Anonymous
Not applicable

Hi, @JackWren 
Thank you for your prompt response.

 

If you find a solution, we encourage you to return to the forum, share your findings, and consider marking it as the accepted solution. Members with similar questions will greatly appreciate your contribution.

 

Of course, if you have any interim results, we also welcome you to share them with us.

 

Thank you in advance for your efforts.

 

Best Regards,

Leroy Lu

Anonymous
Not applicable

Hi, @JackWren 
Thanks for your detailed explanation, I am more than willing to help you out.

Regarding the data import issue, I have thought of an alternative solution:

 

1.You can try using the Table Import Wizard tool:

vlinyulumsft_0-1733816156391.png

For more details, please refer to:

Importing tables and data modeling | Tabular Editor Documentation

 

2.Secondly, after completing the import in Desktop, use it in the app:

vlinyulumsft_1-1733816156393.png

For more details, please refer to:

 Get data from comma separated value (CSV) files - Power BI | Microsoft Learn
Combine files overview - Power Query | Microsoft Learn
Combine CSV files in Power Query - Power Query | Microsoft Learn

 

For the issue you mentioned, it would be more advisable to post your question in Tabular Editor community to get professional support in time.

Here is the link to the forum you need:

GitHub - TabularEditor/TabularEditor3: Bug reports, feature requests, discussion and documentation f...

Tabular Editor 3


Of course, if you have any new discoveries or questions, please feel free to get in touch with us.
 

Best Regards,

Leroy Lu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.