The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
I have two tables, first one is orders table which has order date,category ,subcategory,product ,sales and profit.And my second table has year category,subcategory,target.How do i connect these two tables. I nees orderdate in my columns. sales and profit in rows and target in constant line.
Solved! Go to Solution.
Hi @lizzzz08
This is not a matter of "merging" columns, but rather designing a proper data model that supports your business analysis needs.
You should build a model that includes:
A Sales table (your fact table with order-level data),
A Targets table (aggregated goals by year/category/subcategory),
A Date dimension table to link by year,
And a Category/Subcategory dimension table to connect both fact tables.
This way, you can analyze performance against targets on both Category and SubCategory levels, just like in the chart below.
For more information please refer to the linked documentations :
https://learn.microsoft.com/en-us/power-bi/guidance/star-schema
And blog post
https://databear.com/adding-targets-in-power-bi-report/
The pbix is attached you can follow my steps
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Hi @lizzzz08 To achieve this you just need to create two Key Columns one in Orders Table and other in the Target table to establish a relationship between at the most granular possible.
1. Create a Key column in Orders Table
Key = Orders[Sub-Category] & FORMAT(YEAR(Orders[Order Date]),"#")
2. Create a Key column in Target table
Key = Targets[Sub-Category] & FORMAT(Targets[Year],"#")
3. Now establish a relationship between both tables based on Key column
4. You can achieve your sample view like below
Also attached the pbix file for your reference.
Thanks,
Jai
Proud to be a Super User! | |
Hi @lizzzz08
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided by the community members for the issue worked. If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.
Thanks
Hi @lizzzz08
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If our responses has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.
Hi @lizzzz08
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
Hi @lizzzz08 To achieve this you just need to create two Key Columns one in Orders Table and other in the Target table to establish a relationship between at the most granular possible.
1. Create a Key column in Orders Table
Key = Orders[Sub-Category] & FORMAT(YEAR(Orders[Order Date]),"#")
2. Create a Key column in Target table
Key = Targets[Sub-Category] & FORMAT(Targets[Year],"#")
3. Now establish a relationship between both tables based on Key column
4. You can achieve your sample view like below
Also attached the pbix file for your reference.
Thanks,
Jai
Proud to be a Super User! | |
Hi @lizzzz08
This is not a matter of "merging" columns, but rather designing a proper data model that supports your business analysis needs.
You should build a model that includes:
A Sales table (your fact table with order-level data),
A Targets table (aggregated goals by year/category/subcategory),
A Date dimension table to link by year,
And a Category/Subcategory dimension table to connect both fact tables.
This way, you can analyze performance against targets on both Category and SubCategory levels, just like in the chart below.
For more information please refer to the linked documentations :
https://learn.microsoft.com/en-us/power-bi/guidance/star-schema
And blog post
https://databear.com/adding-targets-in-power-bi-report/
The pbix is attached you can follow my steps
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
User | Count |
---|---|
65 | |
62 | |
60 | |
53 | |
28 |
User | Count |
---|---|
181 | |
82 | |
67 | |
47 | |
44 |