Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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 create a chart like this:
how can I recreate this in power bi? specifically with the category labels under the bars
thank you!!
Solved! Go to Solution.
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.
Hi @Anonymous ,
With the data you've posted, here's one way of you can achieve your desired result:
Proud to be a Super User!
is it possible to do the unpivot with DAX?
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.
do you have a quick example of the switch statment to use in this case? I just created the table of all the categories for the axis
can I unpivot using dax? I dont want to mess up all my other visuals
As a matter of fact, yes you can. I wrote a quick measure to do exactly that. https://community.powerbi.com/t5/Quick-Measures-Gallery/DAX-Unpivot/m-p/574832#M256.
However, that will not solve your problem since you still need something to put in the Axis. Sounds like you are headed down the disconnected table trick, this blog article demonstrates the technique. https://community.powerbi.com/t5/Community-Blog/Solving-Attendance-with-the-Disconnected-Table-Trick...
thank you!! you are awesome!
User | Count |
---|---|
90 | |
74 | |
67 | |
63 | |
55 |
User | Count |
---|---|
102 | |
93 | |
73 | |
60 | |
59 |