Power Bi

Business Intelligence (BI) is the process of collecting, analyzing, and transforming raw data into meaningful insights that help businesses make informed decisions.

Simple Definition:

BI = Data → Information → Decision-Making


⚔️ Excel vs Power Query: Key Differences

Feature Excel Power Query
Main Use Data analysis, reporting, and calculations Data extraction, transformation, and loading (ETL)
Interface Manual (cells, formulas, pivot tables) No-code/low-code UI for data manipulation
Data Handling Better for small datasets Handles large data more efficiently
Automation Limited (macros, VBA) Highly automated, repeatable queries
Data Sources Excel files, limited databases Wide variety: databases, web, APIs, Excel, etc.
Live Connection Manual refresh Dynamic, auto-refresh possible

When to Use Power BI vs Excel

🟡 Use Excel When:

🔵 Use Power BI When:

🎯 Example Use Cases


Dax functions

📊 1. Aggregation Functions

Function Purpose Example
SUM() Adds values SUM(Sales[Amount])
AVERAGE() Mean value AVERAGE(Orders[Quantity])
MIN() / MAX() Min/max MIN(Dates[Year])
COUNT() Count non-blank COUNT(Customers[Name])
COUNTA() Count non-empty COUNTA(Orders[Product])
COUNTROWS() Count rows in table COUNTROWS(Orders)
DISTINCTCOUNT() Count unique values DISTINCTCOUNT(Sales[ProductID])

📅 2. Date & Time Functions

Function Purpose Example
TODAY() Current date TODAY()
NOW() Current date & time NOW()
YEAR(), MONTH(), DAY() Extract from date YEAR(Sales[Date])
DATE() Create a date DATE(2023, 12, 1)
DATEDIFF() Difference between dates DATEDIFF(Orders[OrderDate], Orders[ShipDate], DAY)
EOMONTH() End of month EOMONTH(Sales[Date], 0)
WEEKNUM() Week number WEEKNUM(Sales[Date])

🔗 3. Relationship & Filter Functions

Function Purpose Example
RELATED() Get value from related table (many-to-one) RELATED(Customer[Name])
RELATEDTABLE() Get table of related rows (one-to-many) COUNTROWS(RELATEDTABLE(Orders))
LOOKUPVALUE() Fetch a value like VLOOKUP LOOKUPVALUE(Customer[Name], Customer[ID], Sales[CustomerID])
USERELATIONSHIP() Activate inactive relationship CALCULATE(SUM(Sales[Amount]), USERELATIONSHIP(Calendar[Date], Sales[ShipDate]))

🎯 4. Filter & Context Functions

Function Purpose Example
CALCULATE() Change filter context CALCULATE(SUM(Sales[Amount]), Region[Name] = "West")
FILTER() Return filtered table FILTER(Sales, Sales[Amount] > 1000)
ALL() Remove filters CALCULATE(SUM(Sales[Amount]), ALL(Sales))
ALLEXCEPT() Remove all filters except some columns ALLEXCEPT(Sales, Sales[Region])
VALUES() Unique column values VALUES(Products[Category])

🔠 Text Functions in DAX

Function(s) Purpose Example
CONCATENATE() Join two text values CONCATENATE(FirstName, LastName)
CONCATENATEX() Join text across table rows CONCATENATEX(Employees, Employees[FirstName], ", ")
LEFT() Get left part of text LEFT(ProductName, 1)
RIGHT() Get right part of text RIGHT(ProductCode, 3)
MID() Extract substring MID(ProductName, 3, 4)
SEARCH() Find text position (case-insensitive) SEARCH(" ", FullName, 1, -1)
FIND() Find text position (case-sensitive) FIND("Pro", ProductName, 1)
UPPER() Convert to uppercase UPPER(FirstName)
LOWER() Convert to lowercase LOWER(LastName)
TRIM() Remove extra spaces TRIM(Name)
SUBSTITUTE() Replace part of text SUBSTITUTE(Category, "Old", "New")
FORMAT() Convert number/date to text FORMAT(Date, "MMM YYYY")``FORMAT(Amount, "₹#,##0.00")