This makes time-based analysis much easier.
๐น 12. Why Month Number Is Important
If you display:
January
February
March
April
Power BI may sort month names alphabetically depending on the setup.
You need a:
Month Number
January โ 1
February โ 2
March โ 3
Then sort Month by Month Number.
๐น 13. Understand the Grain
Before creating relationships, ask:
"What does one row represent?"
For example:
Sales table
โ One row = One order
or:
Sales table
โ One row = One order item
These are different grains.
If you don't understand the grain, you can accidentally double-count sales.
๐น 14. Example of a Grain Problem
Suppose one order contains:
Order 1001
Laptop โ โน60,000
Mouse โ โน2,000
The order-item table has two rows.
If you join this with another table incorrectly, the โน62,000 order value could potentially be repeated.
So before creating relationships or calculations:
Always understand the grain of your tables.
๐น 15. Active and Inactive Relationships
Sometimes two tables can have more than one possible relationship.
For example, Sales may contain:
Order_Date
Ship_Date
Both could connect to the Date table.
But Power BI generally allows only one active relationship between the same pair of tables at a time.
The other relationship can be inactive and activated when needed using DAX.
This becomes important when building advanced date analysis.
๐น 16. Filter Direction
Relationships control how filters move between tables.
In a simple star schema:
Customer
โ
Sales
filters usually flow from the dimension toward the fact table.
Avoid using bi-directional filtering everywhere.
It can create:
โข Ambiguous relationships
โข Unexpected results
โข Difficult-to-debug models
โข Performance issues
๐น 17. Don't Create Relationships Just Because Column Names Match
For example:
Customer_ID
appearing in two tables doesn't automatically mean they should be connected.
Check:
โ Same business meaning
โ Compatible data type
โ Correct grain
โ Unique values on the "one" side
โ Correct cardinality
๐ฏ Interview Question
What is the difference between a Fact Table and a Dimension Table?
Fact Table
Contains business transactions and measurable values.
Example:
"Sales, Quantity, Cost"
Dimension Table
Contains descriptive information used to analyze those transactions.
Example:
"Customer, Product, Date, Region"
Easy way to remember:
Fact = What happened
Dimension = Describe what happened
๐ก Key Lesson
Don't build your Power BI visuals before understanding your data model.
A good model makes your calculations easier, your reports more reliable, and your analysis much easier to maintain.
๐ Double Tap โค๏ธ For More
Post #3122
2.92K
- โค 9