Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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:
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 |
---|---|
77 | |
74 | |
42 | |
32 | |
28 |
User | Count |
---|---|
100 | |
93 | |
52 | |
50 | |
48 |