Reply
avatar user
Anonymous
Not applicable
Partially syndicated - Outbound

How to get multiple category lines with bar chart

Hi Experts

 

I want to be able to show a single bar chart and the individual lines that make up that bar chart on a line and bar chart graph.

 

1. Bar lines should tell overall sales amount by month.

2. multiple lines should represent company sales amount.

 

CompanyNameDateSaleAmount
CompanyA01/01/201929000
CompanyB01/02/201935000
Companyc01/03/201943000
CompanyA01/04/201927000
CompanyB01/05/201945000
Companyc01/06/201921000
CompanyA01/07/201926000
CompanyB01/08/201927285
Companyc01/09/201926035
CompanyA01/10/201924785
CompanyB01/11/201923535
Companyc01/12/201922285

 

 

1 ACCEPTED SOLUTION
v-deddai1-msft
Community Support
Community Support

Syndicated - Outbound

Hi @Anonymous ,

 

You can create a disconnected table:

 

Table 2 = UNION(ROW("legend","overall"),VALUES('Table'[CompanyName]))

 

Then you can use stacked area chart for instead  with the following measure:

Measure = IF(MAX('Table 2'[legend]) = "overall",CALCULATE(SUM('Table'[SaleAmount]),ALL('Table'[CompanyName])),CALCULATE(SUM('Table'[SaleAmount]),TREATAS(VALUES('Table 2'[legend]),'Table'[CompanyName])))

 

Capture4.PNG

 

Please refer to the pbix file.

 

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

 

Best Regards,

Dedmon Dai

 

View solution in original post

3 REPLIES 3
v-deddai1-msft
Community Support
Community Support

Syndicated - Outbound

Hi @Anonymous ,

 

You can create a disconnected table:

 

Table 2 = UNION(ROW("legend","overall"),VALUES('Table'[CompanyName]))

 

Then you can use stacked area chart for instead  with the following measure:

Measure = IF(MAX('Table 2'[legend]) = "overall",CALCULATE(SUM('Table'[SaleAmount]),ALL('Table'[CompanyName])),CALCULATE(SUM('Table'[SaleAmount]),TREATAS(VALUES('Table 2'[legend]),'Table'[CompanyName])))

 

Capture4.PNG

 

Please refer to the pbix file.

 

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

 

Best Regards,

Dedmon Dai

 

avatar user
Anonymous
Not applicable

amitchandak
Super User
Super User

Syndicated - Outbound

@Anonymous , As of now with standard visual you can not have lines split by the legend in case of clustered bar visual.

 

You can only have that in the line visual with both axes. (Secondary line be only one)

 

Or check some custom visual

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
avatar user

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)