The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi Everyone,
I have the below tabluar data and I have to build a simple stacked bar graph based on this.
And eventually the graph would look like this:
However, I would like to represent the graph in the below format but not able to achieve it in PowerBI.
The difference between the two charts are basically the axis.(Name of measure columns in X-axis and dimension shown as stacked).
Could you advise on how to bring about the second view, please?
Solved! Go to Solution.
Hi @Tiphany01 ,
In Powerbi Desktop, the x-axis field in visual must come from the same column value. If you need to convert to the above visual, you first need to unpiovt column in Powerbi query, convert the four categories to the same column, and then add the corresponding field to the Stacked Bar visual. The reference is as follows:
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you @amitchandak and @v-henryk-mstf for the detailed steps. But in my requirment the dimension column (here: Domain) and the measure columns are being sourced from two different tables. In such a scenario, I don't think we can apply the unpivot right? Could you advise what to do then..
Hi @Tiphany01 ,
For columns from multiple tables, the above results may not be achieved through unpivot. Refer to the similar solution below.Solved: Multiple unpivot in one table - Microsoft Power BI Community
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Tiphany01 ,
In Powerbi Desktop, the x-axis field in visual must come from the same column value. If you need to convert to the above visual, you first need to unpiovt column in Powerbi query, convert the four categories to the same column, and then add the corresponding field to the Stacked Bar visual. The reference is as follows:
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Tiphany01 , for that you have to unpivot the table and then use the new column as axis.