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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
h11
Helper III
Helper III

Stacked Column Chart to show Count of Projects

Hi Team,

 

I have more than 100+ in process projects and I want to show a stack column chart of Project count per vendor site. This is just a sample of 14 projects. I need to show the count of Indian projects vs all other projects in the same stacked column chart.

 

Project TitleVendor Site
Project AIndia
Project BUSA
Project CJapan
Project DSingapore
Project ECanada
Project 1Canada
Project 2India
Project 3Canada
Project 5USA
Project 6Japan
Project 7Canada
Project 8India
Project 9Japan
Project 10India

 

From the above table it is clear that india has 4 projects. So I want a formula to show a column chart where I can show 4 vs 10 (i.e. India vs non Indian Projects count)

 

Thanks in advance

1 ACCEPTED SOLUTION
SamWiseOwl
Community Champion
Community Champion

SWITCH(
    TRUE()
    ,[Vendor Site] = "India""India only projects "
    ,Not(CONTAINSString(Table[Vendor Site],"India")) , "Only non indian vendor projects"
    ,"Other vendors including india projects"
)
 
Try this instead 😁

If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

View solution in original post

11 REPLIES 11
h11
Helper III
Helper III

Hi @SamWiseOwl 

 

I received an enhancement request for the current solution. Please assist me with the following:

 

We have two side-by-side stacked column charts; one displays all vendor sites by their total project count, while the other shows three bars representing only vendors, vendors included, and vendors excluded.

 

The enhancement request is as follows:

 

 

h11_0-1723033512962.png

 

Clicking on a specific bar (vendor site) in the left chart should display the details of that vendor site in the right chart.

 

For instance, clicking on the first vendor site bar, Sturgis, should display the corresponding three bars related to Sturgis on the right side..

 

Note: Please utilize the same sample table previously provided to derive a solution.

 

1st bar on 2nd chart - Sturgis only projects

2nd bar on 2nd chart - All vendors including sturgis projects

3rd bar on 2nd chart - Combination of 1 and 2 i.e. All projects related to Sturgis

h11
Helper III
Helper III

Hi Sam,

 

Thank you for your response. I apologise if I haven't conveyed my question right. All I want to show is India vs non indian projects on the same stacked column chart i.e ( India projects count vs Canada+US+Japan+Singapore projects counts). So, I should be having only two Columns ( One showing only India count and the other showing all non indian vendors together in the same chart) not indiviual columns for all 5 vendors seperately. 

 

Thank you.

SamWiseOwl
Community Champion
Community Champion

HI @h11 

Do the technique shown in the Pie chart but do it in a column chart:

SamWiseOwl_0-1722865302778.png

Or do it directly in the data, right click the Vendor Site column choose New group:

SamWiseOwl_1-1722865372693.png

 

click on India and choose Group.

 

Use the newly created column in your visual.

SamWiseOwl_2-1722865401781.png

Close it down and you will have a new column in your data:

SamWiseOwl_3-1722865421705.png

 

 

Use this column in your column chart 🙂


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

Thank you Sam, I'm almost there!!

 

Now, Let me get into a bit more detail about my requirements. As I mentioned in my earlier post, I have more than 100+ projects. I need to show the column chart by India only projects vs Other vendors including india projects vs only non indian vendor projects.  From the below case we should have the columns as ( 6 vs 5 vs 3)

 

Thank you once again for helping me 🙂

 

Project CountVendor Site
Project AIndia
Project BIndia
Project CCootehill,Singapore,India,Arla
Project DIndia
Project ESingapore,India
Project 1Casa Grande,Granada,Jiaxing,Singapore,India,Jelsert
Project 2India
Project 3India
Project 5India
Project 6Zwolle
Project 7Zwolle
Project 8AltaVista,Casa Grande,Singapore,Cootehill,Granada,Sturgis
Project 9India, Singapore,Casa Grande
Project 10India,Casa Grande,Granada,Jiaxing,Singapore
SamWiseOwl
Community Champion
Community Champion

Hi @h11 
Create a new calculated column like this:

Vendor type =
SWITCH(
    TRUE()
    ,[Vendor Site] = "India", "India only projects "
    ,Not(CONTAINS('India vs Others',[Vendor Site],"India")) , "Only non indian vendor projects"
    ,"Other vendors including india projects"
)
SamWiseOwl_0-1722870163196.png

 


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

Sam,

I applied the same formula in my Power BI, but I'm puzzled by the 'India vs Other' parameter within it. I'm getting an error if I use it. I'm unsure why it was included or what should be substituted for it. Could you clarify its purpose so I can adapt the formula to my own terminology?

 

SWITCH(
    TRUE()
    ,[Vendor Site] = "India""India only projects "
    ,Not(CONTAINS('India vs Others',[Vendor Site],"India")) , "Only non indian vendor projects"
    ,"Other vendors including india projects"
)
 
Thank you!
SamWiseOwl
Community Champion
Community Champion

Ah apologises that is the name of your table 🙂 change it to what ever is correct.


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

Thank you. I used the same exact formula with my table and column names but there is a problem, I'm not getting a seperate value for "Other plants including india projects" and 

"Only non indian vendor projects". I'm getting a combined value of 302 projects with the name "Other plants including india projectsand when I checked the table I see that for all non indian vendor projects without india, got the same name "Other plants including india projects" in the calculated column I added . Please help.

 

h11_0-1722873327637.png

h11_1-1722873697848.png

 

SamWiseOwl
Community Champion
Community Champion

SWITCH(
    TRUE()
    ,[Vendor Site] = "India""India only projects "
    ,Not(CONTAINSString(Table[Vendor Site],"India")) , "Only non indian vendor projects"
    ,"Other vendors including india projects"
)
 
Try this instead 😁

If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

Perfect! You are awesome! I got it! Thanks a ton!

 

SamWiseOwl
Community Champion
Community Champion

Hi @h11 

The easiest thing to do is right click on India within the chart and choose Group data:

SamWiseOwl_0-1722864254744.png

It will look like thiS:

SamWiseOwl_1-1722864291284.png

 



 

 Alternatively you could have a measure that works out how many are NOT the current Vendor and use it in the same column chart:

Non Project = CALCULATE(Count('Project Table'[Project Title]), 'Project Table'[Vendor Site] <> SELECTEDVALUE('Project Table'[Vendor Site]))

SamWiseOwl_0-1722864588386.png

 


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.