Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
zb134
Helper I
Helper I

Show vertical bar chart without grouping items

I have data that spread across columns that I want to show in a vertical bar chart. The problem is the bar chart groups everything together because there really is no x-axis component to define.

 

Year 2021Year 2022Year 2023Year 2023Year 2025
2132126345234323242323423
213232343242332432433243242
31211532432432322343232432
35321134233232432324324343242

 

I want to show the sum of each year on a vertical bar graph with a target for each.

Problem is it get grouped together because I am unable to define a x-axis.

I know unpivot is a possible option but it doesn't work in my case because the actual data has lots of columns and is much more complicated than the sample table shown above.

 

What I end up now is something like this:

zb134_0-1672697828915.png

 

Any suggestion are higly appreciated!

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @zb134 ,

 

The easiest way to do this is to go to the Query Editor, select all columns, and then select Unpivot Columns.

However, you can also perform this operation in DAX, you can perform the following formula

1. Create calculated table.

Table 2 =
UNION(
SELECTCOLUMNS(
    'Table',
    "Year",2021,
    "Value",[Year 2021]),
SELECTCOLUMNS(
    'Table',
    "Year",2022,
    "Value",[Year 2022]),
SELECTCOLUMNS(
    'Table',
    "Year",2023,
    "Value",[Year 2023]),
SELECTCOLUMNS(
    'Table',
    "Year",2024,
    "Value",[Year 2024]),
SELECTCOLUMNS(
    'Table',
    "Year",2025,
    "Value",[Year 2025]))

vyangliumsft_0-1672713301125.png

2. Result:

vyangliumsft_1-1672713301131.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi  @zb134 ,

 

The easiest way to do this is to go to the Query Editor, select all columns, and then select Unpivot Columns.

However, you can also perform this operation in DAX, you can perform the following formula

1. Create calculated table.

Table 2 =
UNION(
SELECTCOLUMNS(
    'Table',
    "Year",2021,
    "Value",[Year 2021]),
SELECTCOLUMNS(
    'Table',
    "Year",2022,
    "Value",[Year 2022]),
SELECTCOLUMNS(
    'Table',
    "Year",2023,
    "Value",[Year 2023]),
SELECTCOLUMNS(
    'Table',
    "Year",2024,
    "Value",[Year 2024]),
SELECTCOLUMNS(
    'Table',
    "Year",2025,
    "Value",[Year 2025]))

vyangliumsft_0-1672713301125.png

2. Result:

vyangliumsft_1-1672713301131.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

I had to do lots of transformations to get it right, but ultimately your directions helped a lot in getting it done!

Thanks for the reply, I know that unpivot can work with sample data given but the real data I am dealing with is not a straightforward colum but rather a Calculated field

 

2023 Calc =
CALCULATE(
[2023],
'Inventory'[Direct vs Indirect] IN { "Direct" },
'Inventory'[Benefit Type] IN { "Costs" },
LASTDATE('Calendar'[Date])
)

 

When I plot it right now using the clustered vertical I get this for year 1 and year 2. The numbers are correct, it's just that they are grouped together that's the issue

zb134_0-1672724454895.png

When I use your suggestion :

Table 2 =
UNION(
SELECTCOLUMNS(
'Inventory',
"Year",2023,
"Value",[2023 Calc]),
SELECTCOLUMNS(
'Inventory',
"Year",2024,
"Value",[Year 2024])
))

 

I end up getting 

zb134_1-1672724977334.png

Not sure where those numbers are coming from, is it just not respecting the filters in the calculated measure?

Nathaniel_C
Community Champion
Community Champion

Hi @zb134 ,
If I understand your question, you are looking for something like this?

Nathaniel_C_0-1672706365029.png

 

Create a measure for SUM () of each year.

YR 2021 = SUM(TableT[Year 2021])

 


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks for the reply but I need it not to be grouped together as shown but seperated under x-axis categories for each year.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.