Reply
Highlighted
Frequent Visitor
Posts: 6
Registered: ‎09-24-2016
Accepted Solution

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

 


Accepted Solutions
Community Support Team
Posts: 5,694
Registered: ‎09-21-2016

Re: combining data of two tables into one graph

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


All Replies
Super User
Posts: 935
Registered: ‎06-09-2016

Re: combining data of two tables into one graph

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.
Community Support Team
Posts: 5,694
Registered: ‎09-21-2016

Re: combining data of two tables into one graph

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.