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
Help required on Power bi model with multiple joins
fact_sales has business date and product id
dim_product table has business_date and product id how we can join on power bi model ?
Solved! Go to Solution.
Hi @Anonymous ,
In Power BI, the correct approach is to maintain a star schema where the dim_product table contains only product-related attributes and does not include business_date, as dates should be handled separately in a dim_date table. The fact_sales table contains both business_date and product_id, allowing it to connect to both dimension tables. To achieve this, create a dim_date table using the CALENDAR function in DAX:
dim_date = CALENDAR(MIN(fact_sales[business_date]), MAX(fact_sales[business_date]))
Next, establish relationships where dim_product[product_id] connects to fact_sales[product_id] in a one-to-many relationship, ensuring that product attributes can filter sales data. Similarly, dim_date[business_date] should connect to fact_sales[business_date], enabling time-based analysis. With this setup, dim_product provides product-level filtering, while dim_date supports date-based aggregations, ensuring a clean and efficient Power BI data model.
Best regards,
Hi @Anonymous ,
In Power BI, the correct approach is to maintain a star schema where the dim_product table contains only product-related attributes and does not include business_date, as dates should be handled separately in a dim_date table. The fact_sales table contains both business_date and product_id, allowing it to connect to both dimension tables. To achieve this, create a dim_date table using the CALENDAR function in DAX:
dim_date = CALENDAR(MIN(fact_sales[business_date]), MAX(fact_sales[business_date]))
Next, establish relationships where dim_product[product_id] connects to fact_sales[product_id] in a one-to-many relationship, ensuring that product attributes can filter sales data. Similarly, dim_date[business_date] should connect to fact_sales[business_date], enabling time-based analysis. With this setup, dim_product provides product-level filtering, while dim_date supports date-based aggregations, ensuring a clean and efficient Power BI data model.
Best regards,
@Anonymous Create a relationship between fact_sales[product_id] and dim_product[product_id].
Create another relationship between fact_sales[business_date] and dim_product[business_date].
Ensure that the cardinality of the relationships is set correctly. Typically, fact_sales will have a many-to-one relationship with dim_product on both product_id and business_date.
But only one will be active relation
Proud to be a Super User! |
|
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 38 | |
| 37 | |
| 28 | |
| 28 |
| User | Count |
|---|---|
| 124 | |
| 89 | |
| 73 | |
| 66 | |
| 65 |