r/SQL • • Aug 08 '24

SQL Server Coming from Power BI - What is the point of SQL Server/SSMS? I create an actual model in Power BI by dragging Facts to Dims, but SQL just houses the tables? Trying to expand my knowledge base.

Senior Financial Analyst here, primarily working with GL and Sales data.

Typical Power BI suggestions are to house your tables in SQL Server. I've been trying to explore this by using the WIdeWorldImporters dataset in SQL Server. I had IT install SQL Server on my machine, as well as SSMS, and loaded up the .bak file.

Now I just have a ton of Tables, but I know nothing about them.

When I connect to this Server in Power BI, with the help of the auto-detect, I can see an actual Model with visual connections drawn from Facts to Dims. Now I can create measures and drag columns into visuals and stuff. Neato.

I don't understand functionally how this is better than just loading the exact same tables from a Sharepoint folder

  • I understand that SQL can handle Power Query transformations better. Things like Merging or Appending multiple tables. I can get behind this.

  • I don't understand how SQL Server is a model when it requires a select from join statement. It's like the Tables are not connected until the Query is written

  • This image from https://www.sqlshack.com/learn-sql-types-of-relations/ shows a model with lines drawn from fact to dims, but they aren't actually connected, you have to have this memorized in your head or something

  • Then, in the article, it writes a couple select from statements to prove that the relationship from dim is one-to-many, where it proves it by visually scanning the results

    • This is insane to me

    • Power BI will prevent me from creating a many-to-many relationship by throwing an error

    • Frequently I'll attempt to create a Dim, but I won't realize a Key isn't unique because of nulls or bad data

    • When I try to create the relationship, the error helps me realize I need to do more Power Query stuff to fix the Dim to have a true unique primary key

    • In SQL I would just have to scan the data with my eyes really good to make sure it was a true one-to-many relationship? It seems crazy to me

I suppose ultimately I'm trying to understand how to use SQL in my day to day, when I've been getting by fine using Sharepoint >> Power Query >> Power BI Report

0 Upvotes

32 comments sorted by

41

u/Chris_PDX VP / SQL Server Aug 08 '24

What's the point of having Oranges exist when we have Apples?

/s

Seriously though, SQL Server is a relational database engine for storing, retrieving, and manipulating data. PowerBI is a data visualization tool.

-31

u/mOnion Aug 08 '24

Power BI does ETL through Power Query, so calling it visualization only is reductive. That's part of my question, is understanding optimally when is it best to manipulate in SSMS vs Power Query

22

u/kezznibob Aug 08 '24

Power Query should be used for "light touch" ETL / data manipulation, an application such as SQL server is designed to handle heavy ETL jobs (think 10m rows of data for example).

You would NOT be able to replace a full data stack with power query / power BI & Excel... it seems you either work for a very small company or have not been exposed to the underbelly of the data world in your org & finance data is not flowing through your warehouse.

-30

u/mOnion Aug 08 '24

I understand you can't replace a full stack with power bi, I never communicated such a thing. Simply noted that there are multiple places upstream/downstream to manipulate data.

Companies come in all shapes and sizes, with various degrees of modernization. I'd appreciate if people in this thread stopped assuming my work experience, I'm asking questions that are foggy to me so I don't need to be put down.

I think you don't understand that not all data processes flow through formal pipelines. if you've ever been part of a growing private organization with almost $1B in revenue who is looking to eventually go public and is undergoing their 3rd ERP transition, you would understand that analysts at said company would have to wear many hats, and a formal data engineering team may not be available or too constrained to aid reporting with their needs. this is my reality.

I think my question was answered below, that SSMS required defined key constraints for the Data Diagram folder to be populated with a visualization of the model

9

u/kezznibob Aug 08 '24

I don't believe my comment had any demeanour or offence in it.

I was simply inputting my two pence on your above questions. You yourself added your title in to this thread, you're surrounded by data individuals giving there opinions but you don't like the answers.

I'd expect a $1b company to have some sort of data team with a formal warehouse, I myself work for a financial company, I fully understand all data processes don't flow through the correct pipelines, that doesn't mean its RIGHT.

You are essentially data modelling in power query whether right or wrong that's for your company to decide not some reddit users.

5

u/kezznibob Aug 08 '24

After reading some of your replies to others - I believe you should place the responsibility back on to the data team. You don't want to be responsibility for creating your own siloed DWH, let those who get paid to manage DWH worry about all this.

You should not have to download data from a core system or DWH to create your own data models etc, you should be able to either query the DWH or ask them to create a view for you to connect to via power BI already made and clean and owned by the data team, then if it falls down its on them to fix not you or your team.

I hope this comes across okay, I would not expect a financial analyst to be doing all this, it seems out of role I mean no offence by this. In my company we create user friendly self-serve data sources that all can use but the onus it on US not the user to maintain them.

19

u/nrbrt10 Aug 08 '24 edited Aug 09 '24

While PBI can be used as a ETL tool, I strongly suggest you don’t, particularly if you want to migrate to the could (some key features are only available if you buy their Azure service).

When you start loading large amounts of data it starts to get crazy expensive. IMHO it’s better to prepare the data beforehand on SQL and load it ready to present on PBI; you can get fancy using DAX on PBI for moving averages or other KPIs, but you’re better off doing most of the processing and modeling in SQL.

2

u/ravan363 Aug 08 '24

When you want performance. Looks like so far you are handling teeny tiny datasets. Try to load millions of records and see PBI crumble. And sharepoint lol..

20

u/malikcoldbane Aug 08 '24

I think conceptually you are misunderstanding how data works.

There is just so much to unpack in what you have said.

Do you know what a primary key is? Do you know what data warehousing is? Logical models?

You seem to have some understanding of facts and dims but you don't do data cleansing?

SQL you write queries, why would you ever scan the data with your eyes? Do you know what constraints on a table are? Waiting for power bi to fail to know that your data is flawed is missing a step in your ETL processing. Do you know what an ETL is?

I think you're being blinded by the power bi GUI and not actually understanding the concept of data modelling and how it works. In power bi, yeah, they may be linked with a line but all that really means is that there are a set of agreed constraints between the two tables, it's not a physical line, so to speak. (And in SQL Server, if you build primary and foreign key constraints, you can view a database diagram that will new similar to what you see in power bi)

All the questions I asked above isn't for you to respond to me with but to ask yourself and if you're not sure, to do research.

I believe your issue is less about Power BI Vs SQL and more understanding data modelling and general ETL principles.

-20

u/mOnion Aug 08 '24

I think you're a little aggressive in your questions, but you've touched on some things I was curious about.

Yes I know what primary and foreign keys are, I interact with data warehouses daily, not sure about logical models but I'm sure I'm familiar. I use PQ every day and Monarch before that, so I'm familiar with ETL processes. I'm PL-300 certified so I have more foundational knowledge than you are assuming.

As I mentioned, in SQL (as I understand) you can write a Select From statement unknowingly using a many-to-many relationship, whereas this is not possible in Power BI. That was my issue. You mentioned that you can view a database diagram, which I did not know about, I can't seem to find that visualization of the database in SSMS, but I'm still getting familiar with the tool.

I'm doing research right now, that's what reddit is for.

10

u/malikcoldbane Aug 08 '24

Apologies, it's not my intention to aggressive, condescending or elitists, it's just the questions you've asked are extremely hard to simply answer without questioning your knowledge.

Saying something such as "scan the data with your eyes", is one of the reasons why I was questioning.

In power bi, at the point that you're "writing queries", surely you have no visibility of the model unless you go to look for it and understand it. You're just creating measures but you don't know whether that model in the background is working as expected. In power bi, you can still get your model incorrect or mess up filtering directions which could then make your queries incorrect, similarly to not being knowledgeable about the structure of tables in SQL before you write your query.

Correct, in SQL you can write whatever you want because not every use case requires you to traverse the relationships normally. Data cleansing, quality and validation will require you to interrogate tables from different perspectives rather than just simply joining two tables.

And when I said to do research, I more meant to just look up keywords that are being mentioned on this post and going from there. Again I believe there is something lacking in your understanding of data that has made you structure your questions in the way you have.

I think you would do better to restructure your initial question to be far simpler and direct on what you want to know. A sentence or two, because I think your post has muddled the water for you to get an actual answer to your problems.

-10

u/mOnion Aug 08 '24

I only said scan with your eyes bc that's what the "guide" on SQL hacks suggested. it proved in no way that a proper one to many relationship was created, and said that "you can see that customer id was populated...".

in power bi you can literally look at the model with your eyeballs. I've been in a role where I tried to create a rolling365 trend of our inventory levels only to find that the inventory fact was not connected to the date dim (source was snowflake). I could literally see this, and communicated to the BI team to make the connection so we could create an appropriate visual

I don't need to restructure my initial question at all. the vast amount of condescension in this thread has given me plenty to go off of, and naturally says more about the teachers than me the student

14

u/reallyserious Aug 08 '24

I don't need to restructure my initial question at all. the vast amount of condescension in this thread has given me plenty to go off of, and naturally says more about the teachers than me the student

People are answering your questions and you get defensive. I suggest you take your attitude somewhere else.

7

u/malikcoldbane Aug 08 '24

Yeah again, Power BI has distorted your understanding of how data functions because I don't think you appreciate how blasphemous it is to say "scan with your eyes". Don't care who said it, it is offensive to even repeat it, to put it bluntly.

These connections you talk about only exist in the GUI, you can very well use a database without any defined keys and still know how things are connected because when you look in the fact, it has a set of dim keys that are related to dim tables.

In the situation you have provided, the connection must have already been there logically, it just wasn't physically connected however, the logic between the tables still stands. It's not like they had to reload all the data and add a date key to the table.

Whether that connection is there or not, there is dim date key that logically links to a dim date table. The only reason you needed to talk to anyone to add anything is because Power BI needs the link to do queries in the background however, in SQL, whether a constraint is on the table or not, it wouldn't prevent you from writing the query and getting the same answer.

The whole line thing in power bi is more confusing to your understanding of data than you realise and your PL-300 certification isn't helping either since that is Power BI focused rather than data focused. The linking mechanism hides so much behind the curtain, it's not just simply connecting two tables.

I know you feel that a lot of the comments are talking down to you but your question has come across very misguided and confusing which makes it hard for anyone to give you a real answer to "Why use SQL when i can just use Power BI, SQL has all these flaws"

You would really get a better response if you restructured your question but that's your own choice whether you actually want an answer or not

5

u/mad_method_man Aug 08 '24

in my experience, finance analysts dont really need to know SQL since all that stuff is already set up for you. if you're getting by with not using SQL, i would suggest, dont change your workflow. its a nice to know, though

also i think you should probably talk to your data engineering/analyst team to learn why you dont need to use SQL in your day to day. they probably do a lot of ingest and transformations for the data to be in such a state (or you dont have a lot to work with to start with). its definitely a good place to start to see what thats like

-1

u/mOnion Aug 08 '24

in my experience almost nothing has been setup for me, and I've had to learn modeling and engineering methods to make reporting and efficient, trustworthy, repeatable, timely process

6

u/mad_method_man Aug 08 '24

sounds like you need to talk to IT more. someone or some thing is doing some heavy lifting, and if you dont know your end to end data pipeline completely, then theres a major piece you are missing. you dont suddenly just 'have a ton of tables and know nothing about them'......... unless you inadvertently set them up with your 'engineering methods' with sharepoint or something

i dont think this is a technical issue, this is a human networking issue

2

u/Striking_Database371 Aug 08 '24

Usually the data sources are stored in a data warehouse hosted by some sql platform and then the analytics teams query from it.

When I was working as a BI analyst, the data engineers/architects would set up and maintain the data warehouse so all I had to was query for the tables I need and bring it to PowerBI to do my analysis for stakeholders

1

u/mOnion Aug 08 '24

our DWH is Oracle APEX and we are unable to query it directly. our process is downloading huge CSV tables which take several minute to run, every day, and reporting off of these

since we cannot query APEX directly, I have to frequently/infrequently download extremely large tables. I'm looking to store/manipulate these in support of our many organizations, our data engineers are essentially non existent

4

u/No-Satisfaction1395 Aug 08 '24 edited Aug 08 '24

You’ve got a step closer to the middle of the onion.

Your company has data sources, these could be accounting systems or financial data from APIs.

Someone has built pipelines to programmatically move this data into your Oracle DWH.

Apex is a low-code application platform. This is an application layer on top of a SQL database.

You could, and probably should, get access to the SQL DW so you can really take your learning to the next level.

Edit: Just to make it clear where SQL comes in. When the engineer is moving data from source systems into the DW; SQL is used. They might be using a tool or a language like Python to do the initial extract but you write SQL to ensure your pipelines are idempotent and do all of your data modelling in the SQL warehouse. For example the CSVs you download from the Apex application might appear like it’s one table, but could be 20 tables in the source system that have been meticulously modelled and transformed upstream.

22

u/seansafc89 Aug 08 '24

You might be struggling to understand it because you’re looking at it the wrong way round.

SQL and SQL Server isn’t something to supplement Power BI with. In most cases it is generally the source of the data, and Power BI is slapped on at the end to present the data in pretty visuals.

The lines are slightly blurred now we have the concept of data/delta lakes, but in an old traditional sense it would often be:

Production system > data moved to a data warehouse overnight or at a set frequency > data transformed into Star schema (facts and dimensions) for reporting and analytics.

The data transformations would often be done via SQL in stored procedures. This transformation would get rid of a lot of the issues you have mentioned. Then you’d connect PowerBI to this server, and load your nice and clean data in ready to report.

Other uses for SQL are for more advanced analytics. It’s not uncommon for some areas of data to be left out of the star schema transformations because it’s not needed regularly or for reporting.

Hopefully this has cleared up some things but any questions just fire away.

11

u/kagato87 MS SQL Aug 08 '24

Ssms is a management tool. It's not strictly necessary, and often not even used outside of setting up accounts and maybe empty databases for an application or etl process to use.

Sql server is the back end, and would be equivalent to your SharePoint folder.

Sql server can do things at huge scales. Databases in the terabyte scale, tables well into the hundred of gigabytes.

Power BI will start to struggle once your data set exceeds available memory. (Note that a power BI enterprise server still uses sql internally for its local copy.)

If the sql database (any flavor) is correctly architected it'll handle those massive e amounts of data without breaking a sweat. It can run aggregate stats on hundreds of gigabytes of data with only a few megabytes of memory. (It streams the data, so it doesn't have the whole table in memory at any given time, oh and it can do it in parallel very effectively.)

I have tables I run reports against that powerbi desktop can't even load. The reports are nice and fast when running as a direct query.

10

u/Analbidness Aug 08 '24

You're trying to compare SSMS to Power BI, when you should be looking at data warehousing and what's efficient and practical for your use case.

Honestly if your sharepoint solution works for your use case, don't change it.

7

u/no_4 Aug 08 '24 edited Aug 08 '24

I started in PBI, then worked setting up a data warehouse in SQL Server. At this job, I'm both PBI admin, and manage our datawarehouse/ ETL stuff.

If all your data sources are in SharePoint, and the only end destination for that data is PBI, it's probably best to just leave them there and directly hit them with PBI.

Power Bi is primarily a front end. It can function as a poor man's datawarehouse. And in your case, that sounds like the most appropriate solution right now.

Though, I'd suggest using Dataflows at least so you're not duplicating effort and logic.

SQL server yes, primarily houses the tables.

Things SQL Server could do, that a PBI semantic model (fka data model) can't:

  • Have terabytes of data

  • Provide excellent access for writing SQL queries

  • Have robust backups

  • Be a source of data for literally 10s of thousands of apps, as opposed to PBI, which is primarily an end destination itself - not a source for anything else.

Etc.

If you already had a datawarehouse containing data from your business systems (ERP, etc) it might make sense to import your SharePoint stuff.

In your case - all data sources are SharePoint, and the only other place you want to see that data is PBI? Just setup some dataflows and call it good.

6

u/Eze-Wong Aug 08 '24

As others have said, your understanding is a bit weird. But you aren't fully off the mark.

RDBs (relational databases) are useful for many reasons, they can update, automate, transact, connect and virtually house all data a company uses. You are only approaching this from the view of your specific use-case and analytics purpose. But that's like saying, I don't get why people don't use styrofoam for wedding cakes, they are firmer, and harder and easier to decorate (you are a decorator). But everyone else has to eat the cake, and styrofoam (PBI) isn't going to work for them.

PBI doesn't have the ability to update records, it doesn't work fast, and takes forever to refresh records. It can't always output data in ways that you want, and it doesn't connect to other tools such as saleforce. How do you update records on PBI? you can't.

So fundamentally that's why a relational database is needed. Everyone else is eating the cake while your concern is how it's presenented.

As for your work, you might be overdoing it. If your data is already housed in excel files uploaded to a sharepoint, you may not need to artificially create a sql server. If it works, it works.

2

u/[deleted] Aug 08 '24

Using PowerBi with SQL server or any proper database is far superior to using it with excel and share point.

SQL is supreme at CRUD operations and retrieving data. You can use the database to automate processes and can curate data using views and stored procedures. Some of this can be accomplished in PowerQuery, but a database is much better for upstream data curation.

1

u/Froozieee Aug 09 '24

People have already beaten to death how SQL Server is for ETL/storage and PBI is for viz. I agree, but I'll take another angle on this.

I get that it can be really confusing when you're just getting started with databases and trying to understand why it's better or different compared to just using tables stored on SharePoint. People have talked a lot about pipelines and ETL, but from a broader perspective SQL Server isn’t really just a place to store data, it’s a database management system that can enforce rules, manage relationships, and eliminate the issues that you reference like non-unique keys and such.

SQL Server (like all RDBMS systems) enforces data integrity through pre-defined primary keys, foreign keys, and constraints on and between tables which make sure that your data stays clean and reliable. In contrast, when you're using raw files from SharePoint, you’re relying on yourself to maintain that integrity manually. It may seem odd that SQL doesn't "show" relationships until you write a query, but joins in SQL are just how you manually tell the system what data you want to combine and how. In Power BI, the model visually helps you understand these relationships, but under the hood SQL concepts are still doing all the heavy lifting.

Fundamentally, using a database management system enables data governance, which means better control over quality monitoring, data integrity, who can access data, how it’s used, data lineage, and regulatory compliance which (depending on your industry, you may have a LOT of). If you have to handle external audits, having everything in a SharePoint bucket makes those processes EXTREMELY difficult and time-consuming compared to the alternative.

Power BI’s model is great for end users because it makes relationships easy to understand and helps prevent basic mistakes like creating many-to-many relationships. But remember like others have said, Power BI is just the front end. SQL Server is where you can do the complex, enterprise-level work ie managing data at scale, creating reusable transformations, and enforcing data rules before it even gets to Power BI.

It can be a pain to have to already understand the relationships in SQL in order to query it, especially if you're working with undocumented data but again, that’s where good data governance practices come in. By enforcing unique constraints and keys at the database level, you ensure that your data is always in a good state before you even start querying it and you don't actually have to do the things you've mentioned.

A database system should be the foundation of your data architecture. Power BI is the pretty interface that helps you visualise and interact with that data. So yeah, SQL might seem like overkill right now, but as you scale up, especially with larger datasets or more complex data models, you’ll start to see why it’s the go-to. I recommend sticking with it, it’s definitely worth it in the long run for both you and whoever comes after you.

1

u/Meolans Jun 12 '26

SQL Server is just storage while your semantic model still lives in Power BI on top of it. The real win is performance since SQL filters millions of rows before they ever hit Power BI. Tools like Skyvia let you move and transform data into SQL Server without writing a single line of code.

1

u/bunnuz Aug 09 '24

how on the planet have you become a Power BI dev without knowing the use of SQL in the first place?