Forum Discussion
Anonymous
6 years agoNot applicable
Formatting a bar graph
Hello all, I have this sample data in Power BI: Users Salesmembers Managers Cars Phones Expenses pagers 10,205 1,500 500 2,000 2,000 1,503 1,500 and I am trying to cr...
- 6 years ago
If that is how your source data is actually formatted, you need to unpivot all of those columns in Power Query and then the solution is trivial. Otherwise, create a disconnected table that lists your columns (categories). Use this as the Axis for your chart. Then create a measure that uses a SWITCH statement and based on the value in the axis, sum the right column as the return value for the measure.
danextian
6 years agoSuper User
Hi Anonymous ,
With the data you've posted, here's one way of you can achieve your desired result:
- Go the Query Editor and select all those columns.
- Then right click and hit Unpivot Columns.
- Unpivot will create two columns: Attribute and Value. Change Attribute to data type text and Value to Number.
- Apply the changes.
- Insert a bar chart. Add Attribute to Axis and Value to Value (make sure that the aggregation is sum).
Anonymous
6 years agoNot applicable
is it possible to do the unpivot with DAX?