Forum Discussion
Create query for a stacked bar chart
Hi Steve!
It is possible to do this in one query with the advanced editor, but to save some headache I would write two then combine them using "Append Queries" (on the Home tab in the Query Editor).
As far as the data structure goes, at the moment, the stacked barchart in PowerBI can only accept one field for value, and one field for Legend. So, if you want your stacks to show Active and Complete, then you'll have have a single column for Task Count (to drag to "Value") and one column for Status (to drag to Legend). Like this:
Module / Environment / Status / Task Count
There will also be a challenge with showing this for Module and Environment. The axis will accept multiple fields, but will only present one field at a time (by drilling down/up). If you want a stack for each module/environment combination, I would consider concatonating the fields.
Hope this helps.
Derek