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
Praj
Helper I
Helper I

How to get individual values in clustered column chart

Hi Everyone,

 

I have been stuck with a problem where I need to identify the individual values of a column and stack that together in a column bar chart. 

 

For example, I have below survey Q&A data and I need to find the individual contributions of each country and then put that value in the bar chart.

Praj_0-1683192633369.png

The output above gives me the overall contributions of each countries, however if I select any individual country(for ex, if i select France, I get the below values where approx, 23% have choosen option 1, 25% have choosen option 2 and 3 and 13% have choosen option 4 and 5)

Praj_1-1683192728770.png

 

I am looking to have the above same values when I deselect France from the filter in comparasion with other countries. I know the value gets divided by overall respondents if i clear filteres but is there any way on how I can get individual values of each countries together.

 

I have attached the .pbix file for reference in the below shared link. Any solution/approach is highly appreciated. 

 

https://drive.google.com/drive/folders/1SoUdJDzWLtrFCvDhNmaB04LiXNMxCXyJ?usp=share_link

 

Cheers,

Praj

 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Praj 
Please refer to your sample file updated as requested.

3.png

CountQ123 = 
VAR Count1 = DISTINCTCOUNT ( 'Q1,Q2,Q3'[Index] )
VAR TotalCount = CALCULATE ( DISTINCTCOUNT ( 'Q1,Q2,Q3'[Index] ), ALLEXCEPT ( 'Q1,Q2,Q3', 'Q1,Q2,Q3'[Country] ) )
RETURN
    DIVIDE ( Count1, TotalCount )

View solution in original post

2 REPLIES 2
tamerj1
Super User
Super User

Hi @Praj 
Please refer to your sample file updated as requested.

3.png

CountQ123 = 
VAR Count1 = DISTINCTCOUNT ( 'Q1,Q2,Q3'[Index] )
VAR TotalCount = CALCULATE ( DISTINCTCOUNT ( 'Q1,Q2,Q3'[Index] ), ALLEXCEPT ( 'Q1,Q2,Q3', 'Q1,Q2,Q3'[Country] ) )
RETURN
    DIVIDE ( Count1, TotalCount )

Hi @tamerj1 ,

 

Thanks for the approach. The solution worked.

 

Cheers,

Praj

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.

Top Solution Authors