Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

How to start using SQL (SMSS) instead of importing whole tables for Power BI report

Hi all,   At the I import data in my power BI report using "get data" --> "SQL Server Analysis Services database". However, now I import the whole table, resulting in slow reports. Recently I hav...
  • selimovd's avatar
    selimovd
    5 years ago

    Hey Anonymous ,

     

    sure, you can also save the SQL query in SQL Server. This is then called a view.

    In Power BI you can just select that view and it behaves like a table. In SQL Server this view is a SELECT to the real table.

     

    To create the view you have to create it in SQL Server. You can do that like this:

     

    CREATE VIEW view_name AS
    SELECT *
    FROM table_name
    WHERE condition;

     

     

    And then you can just select the view in Power BI as table. You can also in SQL Server then query the view like this:

     

    SELECT * FROM
    view_name
    WHERE condition

     

     

    Here is a short introduction to views in SQL:

    SQL: Views - YouTube

     

    If you need any help please let me know.
    If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
     
    Best regards
    Denis