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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
JohnD2
Frequent Visitor

combining data of two tables into one graph

Hi I like to combine two tables of data into one bar chart.

 

this this the first data table:

Forecast data AmountExpecteddateDateofForecast Product 
  801-6-201627-4-2016 Red 
  901-6-20164-5-2016 Red 
  951-6-201611-5-2016 Red 
  981-6-201618-5-2016 Red 
  1001-6-201625-5-2016 Red 
  905-6-20161-5-2016 Green 
  955-6-20168-5-2016 Green 
  1005-6-201615-5-2016 Green 
  1085-6-201622-5-2016 Green 
  1105-6-201629-5-2016 Green 

 

This is the second datatable.

  AmountExpecteddateDateofForecast Product 
actuals data 1011-6-20161-6-2016 Red 
  1125-6-20165-6-2016 Green 

 

 

 

The bar chart could look like this

 

barchart-forecast-actuals.PNG

 

The bars should be clustered by expecteddate and product

 

The last bar of the product (= actuals) may be different color.

 

I like to have this analysis over a month period for example.

 

Any ideaS how to do this?

 

JohnD2

 

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi sridevi,


In your scenario, you should combine the two tables into a single one first.

uniontable = UNION(ADDCOLUMNS(Actual,"Actuals","actual forecast"),ADDCOLUMNS(Forcecast,"Actuals","Forcecast forecast"))


To distinguish the bar color between actual value and forcecast value, you can add anextra legend in the chart.

aa.PNG


If you have any question, please feel free to ask.


Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yulgu-msft
Employee
Employee

Hi sridevi,


In your scenario, you should combine the two tables into a single one first.

uniontable = UNION(ADDCOLUMNS(Actual,"Actuals","actual forecast"),ADDCOLUMNS(Forcecast,"Actuals","Forcecast forecast"))


To distinguish the bar color between actual value and forcecast value, you can add anextra legend in the chart.

aa.PNG


If you have any question, please feel free to ask.


Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
BhaveshPatel
Community Champion
Community Champion

Hi John,

 

Please see attached file here for your solution.

You have to append your Actuals Table onto the Forecast Table and You can load this query into the PowerBI and Create Bar Chart visual with data labels on to visualize your output.

 

Thanks & Regards,

Bhavesh

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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