Free Power BI guide — M code + DAX — live personaliser — no upload

Import CSV into Power BI
Get Data, Power Query
M code and DAX.

Step-by-step guide to import a CSV into Power BI Desktop. Enter your table name and file path — the Power Query M code and DAX starter measures update live, ready to paste into the Advanced Editor and report canvas. Your data never leaves your browser.

Power BI Desktop + Service
Live M code personaliser
DAX starter measures
Step-by-step wizard guide
Always free
Personalise the M code and DAX measures for your dataset  Power BI
Enter your details — M code and DAX update live below
Home → Advanced Editor — paste and click Done
Paste into Power Query Advanced Editor (Home tab → Advanced Editor). Adjust column type list to match your actual columns. 65001 = UTF-8 encoding.
New Measure — paste one at a time into the formula bar
Create measures via Modeling tab → New Measure. Each measure appears in the Fields pane and can be used in any visual.
Import wizard — step by step

Eight steps from CSV on disk to data model in Power BI Desktop.

1
Open Power BI Desktop
Launch Power BI Desktop. If you see the splash screen, click Get data. Otherwise use the Home tab in the ribbon.
2
Get Data → Text/CSV
In the Home ribbon, click Get dataText/CSV. Browse to your CSV file and click Open.
3
Check the preview
Power BI shows a data preview. Verify the delimiter is detected as Comma and the first row is used as headers. Change Encoding to 65001: UTF-8 if you see garbled characters.
4
Transform Data
Click Transform Data (not Load) to open Power Query Editor — this is where you set column types, rename columns and filter rows before loading to the model.
5
Set column types
Click the type icon (ABC / 123 / calendar) above each column header and select the correct type. Power BI auto-detects types but often gets dates and mixed columns wrong — always verify.
6
Rename the query
In the Query Settings pane on the right, update the Name field to something meaningful (e.g. SalesData). This becomes the table name in DAX measures.
7
Close & Apply
Click Close & Apply in the Home ribbon of Power Query Editor. Power BI loads the data into the model — the table appears in the Fields pane on the right.
8
Create visuals
Drag fields from the Fields pane onto the report canvas, or add a visual first and then assign fields. Use the DAX measures from the personaliser above for KPI cards and summary tables.
Keeping the data fresh — refresh options

Choose the right approach based on how often your CSV changes.

Manual refresh

In Power BI Desktop: Home → Refresh. Power BI re-reads the CSV from the same path. The file must stay at the same location. Best for one-off or occasional updates.

OneDrive / SharePoint

Store the CSV in OneDrive or SharePoint. Connect via Get Data → SharePoint Folder or OneDrive connector. Scheduled refresh in Power BI Service works without a gateway.

On-premises gateway

For CSV files on a local server or network share, install Power BI On-premises Data Gateway. This allows scheduled refresh in Power BI Service for files that can't move to the cloud.

Power Query M — useful transformations

Common M code patterns for CSV data in Power Query.

Change column type to Date
// In Power Query Advanced Editor — add after existing steps: #"Changed Type" = Table.TransformColumnTypes( PreviousStep, { {"order_date", type date}, {"ship_date", type date}, {"amount", type number}, {"quantity", Int64.Type}, {"category", type text} } )
Replace PreviousStep with the name of the preceding step in your query (visible in Applied Steps pane). Column names are case-sensitive.
Remove duplicates + filter empty rows
// Remove rows where a key column is null or empty #"Filtered Rows" = Table.SelectRows( Source, each [order_id] <> null and [order_id] <> "" ), // Remove duplicate rows based on key column #"Removed Duplicates" = Table.Distinct( #"Filtered Rows", {"order_id"} )
Add these steps inside the let...in block of your Advanced Editor M code. Each step references the previous one by name.
When do you need CSV to Power BI?
Business dashboards

CSV exports from CRM, ERP, accounting and analytics platforms are the most common Power BI data source. Connecting directly to the CSV and setting up a scheduled refresh produces a dashboard that updates automatically when the CSV is replaced.

Ad hoc reporting

Finance, operations and HR teams frequently need one-off reports from CSV exports. Power BI Desktop produces polished visuals from a CSV in minutes — faster than building the same charts in Excel and easier to share via Power BI Service.

Data model building

Multiple CSV files can be loaded into Power BI and related using the Model view — a simpler approach to multi-table reporting than VLOOKUP chains in Excel. Power Query handles the joins, DAX handles the measures.

Power BI Service publishing

A Power BI Desktop report connected to a CSV can be published to Power BI Service for sharing with the organisation. Move the CSV to SharePoint or OneDrive first to enable scheduled refresh without a gateway.

Related CSV tools
Popular searches
csv to power bi import csv to power bi power bi load csv power bi csv import how to import csv into power bi power bi csv connector power bi read csv file power query m code csv dax measures csv power bi csv refresh power bi csv encoding power bi text csv get data

M code and DAX written
for your table, not a demo. Live.

The M code above sets the correct file path, encoding (UTF-8, 65001) and source format for your exact file. The DAX measures use your table name throughout — no placeholder editing. Both update instantly as you type, so the code you paste is always ready to run.

The eight-step import guide covers every decision point in the Power BI wizard — including the ones that trip up new users: encoding selection, Transform vs Load, and renaming the query before closing Power Query.

Live M code personaliser
File path and table name update the M code instantly — paste directly into Advanced Editor.
DAX starter measures
Row Count, Total, Average, % of Total and YoY — the five measures every Power BI report needs.
Eight-step wizard guide
Every step from Get Data to visual creation — including encoding, column types and query naming.
Refresh options covered
Manual, OneDrive/SharePoint and on-premises gateway — the three paths to scheduled refresh.
Frequently asked questions
How do I import a CSV into Power BI?
In Power BI Desktop: Home tab → Get Data → Text/CSV → browse to your CSV → Open. A preview appears — verify comma delimiter and UTF-8 encoding. Click Transform Data to open Power Query Editor for column type setting, or Load to import directly to the model.
How do I set column types for a CSV in Power BI?
In Power Query Editor, click the type icon (ABC / 123 / calendar) above each column header and select the correct type. For precise control, use Advanced Editor and set types in M code with Table.TransformColumnTypes() — the personaliser above generates this code for you.
How do I refresh a CSV in Power BI?
In Power BI Desktop: Home → Refresh. Power BI re-reads the CSV from the stored path. For scheduled refresh in Power BI Service, move the CSV to OneDrive or SharePoint and reconnect via the cloud connector — no gateway needed. For local files, use the On-premises Data Gateway.
Why is my CSV showing garbled characters in Power BI?
Encoding mismatch. In the CSV import dialog, change Encoding to 65001: Unicode (UTF-8). If the file uses Windows-1252 (common for European CSVs), select 1252: Western European (Windows) instead. The M code personaliser above always sets encoding to 65001.