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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

How to get column in x axis of bar chart using measure

image.png

 

I want to create Graph 1 but my table structure is as Table 2, any measure to achieve this.

Also when table 2 is unpivoted (Table 3) then only its showing total otherwise Total is not appearing in Table 2.

 

Please help me resolve it, Thanking you in advance

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Harsh333,

 

I'm not sure if I got your point accurately. You can create a separate measure for each category.

Measure A = CALCULATE(SUM(Test[A]),ALLEXCEPT(Test,Test[Month]))

Measure B= CALCULATE(SUM(Test[B]),ALLEXCEPT(Test,Test[Month]))

Measure C= CALCULATE(SUM(Test[C]),ALLEXCEPT(Test,Test[Month]))

Measure D= CALCULATE(SUM(Test[D]),ALLEXCEPT(Test,Test[Month]))

Measure E= CALCULATE(SUM(Test[E]),ALLEXCEPT(Test,Test[Month]))

Measure FYFC = CALCULATE(SUM(Test[FYFC]),ALLEXCEPT(Test,Test[Month]))

 

Then put your measure in the chart, you will get a result like this:

vcaitlynmstf_0-1629109357084.png

 

 

There is another, more convenient solution but it does not use measure.

Based on what you mentioned above, you can unpivot Table2. You can enter data after unpivot into Power BI Desktop as Table 3.

Then use Table 3 to create a matrix like this:

vcaitlynmstf_1-1629109357089.png

 

 

Then adjust the matrix chart to a column chart. Put category in Axis. You can see this:

vcaitlynmstf_2-1629109357094.png

 

A demo is attached for your reference.

 

Hope it helps.

 

Best Regards,

Caitlyn Yan

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

3 REPLIES 3
Anonymous
Not applicable

Hi @Harsh333,

 

I'm not sure if I got your point accurately. You can create a separate measure for each category.

Measure A = CALCULATE(SUM(Test[A]),ALLEXCEPT(Test,Test[Month]))

Measure B= CALCULATE(SUM(Test[B]),ALLEXCEPT(Test,Test[Month]))

Measure C= CALCULATE(SUM(Test[C]),ALLEXCEPT(Test,Test[Month]))

Measure D= CALCULATE(SUM(Test[D]),ALLEXCEPT(Test,Test[Month]))

Measure E= CALCULATE(SUM(Test[E]),ALLEXCEPT(Test,Test[Month]))

Measure FYFC = CALCULATE(SUM(Test[FYFC]),ALLEXCEPT(Test,Test[Month]))

 

Then put your measure in the chart, you will get a result like this:

vcaitlynmstf_0-1629109357084.png

 

 

There is another, more convenient solution but it does not use measure.

Based on what you mentioned above, you can unpivot Table2. You can enter data after unpivot into Power BI Desktop as Table 3.

Then use Table 3 to create a matrix like this:

vcaitlynmstf_1-1629109357089.png

 

 

Then adjust the matrix chart to a column chart. Put category in Axis. You can see this:

vcaitlynmstf_2-1629109357094.png

 

A demo is attached for your reference.

 

Hope it helps.

 

Best Regards,

Caitlyn Yan

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

 

amitchandak
Super User
Super User

@Anonymous , refer if this custom visual can help

 

https://appsource.microsoft.com/en-us/product/power-bi-visuals/wa200000675?tab=overview

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak 

Sorry but I think you misunderstood my problem:

I want to created above bar graph (1) if my table was structured as (2).

not bar graph with table.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.