Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Microbz
Regular Visitor

Compare actual vs planned

Maybe a rookie question, but then again I am a rookie :). I have two tables "Plan" and "Dashboard" both of which have a column for product type (PRODUCT_CODE/PLAN_CODE), amount of product (PRODUCT_KG/REC_PROD_KG) and date. The "Plan" table contains the monthly goal for each product type in kilograms. The "Dashboard" table contains the actual product amount per production batch per product type. I have a third created table, CALENDAR,  which I used to create date relationship between "Dashboard" and "Plan" tables. I want a bar graph that displays the planned product sum for each product type and actual sum of product produced with the graph sliced on date (CALENDAR). The date slicer works fine for individual graphs of each, planned and actual, but when I put them on the same graph the planned defaults to total product amount by product type for entire Plan table. I thought I needed a relationship for product type (i.e. PLAN_CODE & PRODUCT_CODE), but this is a many-to-many and PBI doesn't like that. I tried creating a seperate PRODUCT_CODE table and set up relationship to Plan and Dashboard tables then used PRODUCT_CODE table as the x-axis for bar graph but no luck. Any suggestions?
Microbz_1-1644185061179.pngMicrobz_2-1644185080893.png

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Microbz , If plan_code and product_code have the same values. You need to create a new table using plan code and product code join with both tables and use it

 

new table

new dim = distinct(union(distinct(plan[plan_code]),distinct(dashboard[product_code])))

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
Microbz
Regular Visitor

Thanks @amitchandak , I was thinking (hoping?) to maintain as two independent tables but in the end merging was easiest. Cheers!

amitchandak
Super User
Super User

@Microbz , If plan_code and product_code have the same values. You need to create a new table using plan code and product code join with both tables and use it

 

new table

new dim = distinct(union(distinct(plan[plan_code]),distinct(dashboard[product_code])))

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.