Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello,
I'm importing a set of tables from a SQL Server DB to Power BI Desktop.
It's a huge database and I'm selecting only some of its tables.
However, these tables have empty columns or columns with zeros only, so I've created two M functions to apply to each and every table to "clean" them.
Is it possible to specify an SQL command in the import settings to fetch only "valid" columns, thus avoiding loading Power BI and custom functions?
Can anyone please share sucha a SQL command?
Thank you!
Solved! Go to Solution.
Hi @webportal,
I'm importing a set of tables from a SQL Server DB to Power BI Desktop.
It's a huge database and I'm selecting only some of its tables.
However, these tables have empty columns or columns with zeros only, so I've created two M functions to apply to each and every table to "clean" them.
Is it possible to specify an SQL command in the import settings to fetch only "valid" columns, thus avoiding loading Power BI and custom functions?
Can anyone please share sucha a SQL command?
The SQL query you want to use in Power BI when you get data is the same as you query the data in SQL Database.
You could refer to the queries in the thread here. You could also have a reference of IS NOT NULL .
Best Regards,
Cherry
Hi @webportal,
I'm importing a set of tables from a SQL Server DB to Power BI Desktop.
It's a huge database and I'm selecting only some of its tables.
However, these tables have empty columns or columns with zeros only, so I've created two M functions to apply to each and every table to "clean" them.
Is it possible to specify an SQL command in the import settings to fetch only "valid" columns, thus avoiding loading Power BI and custom functions?
Can anyone please share sucha a SQL command?
The SQL query you want to use in Power BI when you get data is the same as you query the data in SQL Database.
You could refer to the queries in the thread here. You could also have a reference of IS NOT NULL .
Best Regards,
Cherry
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 36 | |
| 34 | |
| 31 | |
| 27 |
| User | Count |
|---|---|
| 135 | |
| 103 | |
| 65 | |
| 61 | |
| 55 |