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

Stack Column Chart to count the no of projects

Hi All,

 

I received an enhancement request for the solution (Solved: Re: Stacked Column Chart to show Count of Projects - Microsoft Fabric Community). 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-1723215710111.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 in the below requested format related to Sturgis on the right side..

 

Requested Format:

 

1st bar on right chart - Sturgis only projects

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

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

 

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

 

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 6Sturgis
Project 7Sturgis
Project 8AltaVista,Casa Grande,Singapore,Cootehill,Granada,Sturgis
Project 9India, Singapore,Casa Grande
Project 10India,Casa Grande,Granada,Jiaxing,Singapore

 

Thank you!

 

Stacked Column Chart to show Count of Projects @SamWiseOwl 

8 REPLIES 8
Ashish_Mathur
Super User
Super User

Hi,

Based on the table that you have shared, show the expected result very clearly in a Table format.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
h11
Helper III
Helper III

Hi Sam,

 

I tried but no luck. I used the same formula. Also applied the format, edit interaction filter on the chart and see no difference.

 

h11_0-1723223763348.png

 

SamWiseOwl
Community Champion
Community Champion

Download this and see if there are any differences:
Vendor in list.pbix


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 for sharing the PBI file. I double checked and followed the same procedure.

 

I'm encountering an issue where the count of projects is only displayed for a few vendors, and moreover, all three bars are showing the same count.

 

h11_0-1723225901922.png

 

h11_1-1723226057163.png

 

Clicking on each bar of the 2nd chart to view project details in the table below does not display the corresponding projects. Instead, it reverts to the original graph. To cross verify, I added a table in your power BI to see if it is working fine. Your file also didn't show the correct project details when I clicked on each bar of 2nd chart. 

 

h11_2-1723226279747.png

 

 

SamWiseOwl
Community Champion
Community Champion

Hi @h11 

The structure of your file must be different to mine.

Please modify the sample file I sent you to reflect the structure of your and return it.


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.

SamWiseOwl
Community Champion
Community Champion

Hi @h11 

Create a column with the 3 variants in it:

SamWiseOwl_0-1723217373136.png

Use this as your X axis. Add a new measure =

Is Selected Vendor =
var selectedType = SELECTEDVALUE('Project Type'[Project Type])
var selectedVendor = SELECTEDVALUE('India vs Others'[Vendor Site])
RETURN
SWITCH(
    selectedType
    ,"Solo Projects"
    ,COUNTROWS(FILTER(all('India vs Others'), 'India vs Others'[Vendor Site] = selectedVendor))
    ,"Projects with others"
    ,COUNTROWS(FILTER(all('India vs Others'), CONTAINSSTRING('India vs Others'[Vendor Site],selectedVendor)))
    ,COUNTROWS(FILTER(All('India vs Others'), CONTAINSSTRING('India vs Others'[Vendor Site],selectedVendor)))
    )
Put this as your Y axis.
 
Make sure you turn your Left chart to interaction type FILTER:
SamWiseOwl_1-1723218271826.png

 

 

I'm sure someone can come up with a more elegant solution!


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.

Hi Sam,

 

Thank you for this solution. I really appreciate it.

 

The 3rd bar in the table should not be "Without" it should be a total of 1 and 2nd bar. 

 

For example - Solo Projects = 5

Projects with others = 7

3rd graph should show total of 1 and 2 i.e. 5+7 = 12

 

Thank you!

 

SamWiseOwl
Community Champion
Community Champion

RETURN

SWITCH(

    selectedType

    ,"Solo Projects"

    ,COUNTROWS(FILTER(all('India vs Others'), 'India vs Others'[Vendor Site] = selectedVendor))

    ,"Projects with others"

    ,COUNTROWS(FILTER(all('India vs Others'),  'India vs Others'[Vendor Site] <> selectedVendor && CONTAINSSTRING('India vs Others'[Vendor Site],selectedVendor)))

    ,COUNTROWS(FILTER(All('India vs Others'), CONTAINSSTRING('India vs Others'[Vendor Site],selectedVendor)))

    )


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.