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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Optimusprime_25
Resolver I
Resolver I

Issue with Stacked Colum Chart

I have a requirement where I have to show data in a Stacked Column Chart.

In X-axis I have current year MTD and previous year MTD, basically those are measures.

In Y axis I have to show data according to the Product.(Dimension)

In Product I have 3 different categories in product which are A,B and C.

So now I have to show data for current year sales mtd 2024 and previous year sales mtd 2023 in X axis for different categories (product) in Y axis

7 REPLIES 7
Gabry
Resolver III
Resolver III

So what's your issue?

Asper requirement we have to show the data in stacked column chart but the data which we have we couldn't able to show that.

In Stacked column chart we can show only categories in X axis and in Y axis we can show only measures, butaccording to the reuirement we have to show vice versa.

we have to show previous year mtd and current year mtd in x axis and Categories in Y axis.

Hi @Optimusprime_25 ,

I create a table and two simple measures as you mentioned.

vyilongmsft_0-1710395372397.png

mtd 2023 = CALCULATE(SUM('Table'[2023-1])+SUM('Table'[2023-2]))
mtd 2024 = CALCULATE(SUM('Table'[2024-1])+SUM('Table'[2024-2]))

vyilongmsft_1-1710395437501.png

When we select the Stacked column chart, we can not let the mesures in X-axis. We just can let them in Y-axis.

vyilongmsft_2-1710395643591.png

vyilongmsft_3-1710395678438.png

I think you can use Stacked bar chart. It can let the measures in X-axis.

vyilongmsft_4-1710395811488.png

It can also get what you want.

vyilongmsft_5-1710395856883.png

 

 

Best Regards

Yilong Zhou

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

Hello @v-yilong-msft , 

 

Thanks for your response.

@Ritaf1983 @amitchandak @Idrissshatila @Daniel29195 Could you please help me to resolve the issue.

We have to show the chart in below way.

Optimusprime_25_0-1710483734689.png

We have Filetrs as Month and Year based on the selected fulter values we have to show data accordingly in below charts.

We have separate measures for current year and previous year. We have to show data according to the Categories for the selected year and it's previous year.

Instead of measures in stacks we have to show category in stacks. I hope you got the requirement.

Thank you.

Hi @Optimusprime_25 
Unfortunately, I didn't understand what are you trying to do...
There are just tables in the image, can you show the desired graph?

Hi @Ritaf1983 ,

Thanks for your response.

Below is the sameple data for the month of January, 2024.

CategoriesDateMonthYearSales
A1/1/2024jan20243
B1/2/2024jan20244
C1/3/2024jan20244
D1/4/2024jan20244
E1/5/2024jan20244
A1/6/2024jan20243
B1/7/2024jan20244
C1/8/2024jan20244
D1/9/2024jan20244
E1/10/2024jan20244
A1/11/2024jan20243
B1/12/2024jan20244
C1/13/2024jan20244
D1/14/2024jan20244
E1/15/2024jan20244
A1/16/2024jan20243
B1/17/2024jan20244
C1/18/2024jan20244
D1/19/2024jan20244
E1/20/2024jan20244
A1/21/2024jan20243
B1/22/2024jan20242
C1/23/2024jan20242
D1/24/2024jan20242
E1/25/2024jan20242
A1/26/2024jan20243
B1/27/2024jan20242
C1/28/2024jan20242
D1/29/2024jan20242
E1/30/2024jan20242
A1/31/2024jan20242

 

In the similar waywe have data for previous years such as 2022 and 2023 for different Categories as you can see in the data.

Nowe  we have to calculate the MTD sales and YTD sales for the selected Month and Year for different categories and show it is Stacked column chart.

Ex: 

Optimusprime_25_2-1710493637838.png

How to write the measures. We have to show MTD selected year, MTD Previous year, YTD Selected year and YTD Previous year in X axis and in Y axis we have to show data according to different categories.

 

Thank you.

 

Hi @Optimusprime_25 ,

Still the original problem, if you want to put measure on the X-axis of the Stacked column chart is unlikely, because desktop does not support it.

 

 

Best Regards

Yilong Zhou

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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