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
weakneee
Frequent Visitor

PORTION OF A WHOLE | PIE CHART

Hi, 

I hope you're doing well.

 

I believe that I have a quite simple doubt about representation in a pie chart. 

 

I want to represent a portion of a whole in the chart, but, instead of display the difference, it is presenting the summing of the values. 

 

I have 302 "MATRICULA" and 226 of them did "TREINAMENTO 1". In the chart is presented the summing of these values, treating as they're different, but the latter is inside of that. How can I treat the values as one, without summing? 

 

weakneee_0-1675614230032.png

 

 

1 ACCEPTED SOLUTION
andrewpirie
Resolver II
Resolver II

I agree with eliasayy's solution, below are some additional details but it's the same solution they've given.

 

Assuming you have a 1:M relationship from Matriculas to Treinamentos, one solution is to add measures to calculate both portions of the visual: 

 

QTD. TREINAMENTO 1 = 
    CALCULATE(
        COUNTROWS(
            FILTER(
                RELATEDTABLE('Treinamentos de Janiero'),
                'Treinamentos de Janiero'[Treinamento - Nome] = "CNV"
        )
    )
)
MATRICULAS = COUNTROWS(Matriculas)
MATRICULAS WITH NO TREINAMENTO 1 = [MATRICULAS] - [QTD. TREINAMENTO 1]

 

Add both [QTD. TREINAMENTO 1] and [MATRICULAS WITH NO TREINAMENTO 1] to the visual's Values fields

 

andrewpirie_0-1675649250202.png

 


Note that you will not be able to filter other visuals by selecting the two categories on this visual - if that's required, you'll need a more complex solution.

View solution in original post

4 REPLIES 4
andrewpirie
Resolver II
Resolver II

I agree with eliasayy's solution, below are some additional details but it's the same solution they've given.

 

Assuming you have a 1:M relationship from Matriculas to Treinamentos, one solution is to add measures to calculate both portions of the visual: 

 

QTD. TREINAMENTO 1 = 
    CALCULATE(
        COUNTROWS(
            FILTER(
                RELATEDTABLE('Treinamentos de Janiero'),
                'Treinamentos de Janiero'[Treinamento - Nome] = "CNV"
        )
    )
)
MATRICULAS = COUNTROWS(Matriculas)
MATRICULAS WITH NO TREINAMENTO 1 = [MATRICULAS] - [QTD. TREINAMENTO 1]

 

Add both [QTD. TREINAMENTO 1] and [MATRICULAS WITH NO TREINAMENTO 1] to the visual's Values fields

 

andrewpirie_0-1675649250202.png

 


Note that you will not be able to filter other visuals by selecting the two categories on this visual - if that's required, you'll need a more complex solution.

Hi, @andrewpirie
Thank you so much! This is what I what wanted.
The other visuals I can work separately. 

 

Once again, thank you for taking your time to help me. 

 

eliasayy
Impactful Individual
Impactful Individual

hello @weakneee , i think what youre asking for is if we can just put the "TREINAMENTO 1" measure related to "MATRICULA" as the max value and not sum it up, i honestly think its impossible BUT a workaround could be give,

eliasayy_2-1675640561211.png

 

lets say 
count all = MATRICULA
count of = TREINAMENTO 1
and extra = count all - count of

now just change the color of "extra" to match your background and put the data label inside and choose color same as background too and just change label name of "extra" to space so it doesnt show in legend.
i hope this helps

 

Hi, @eliasayy . 

 

I hope your doing fine! 

 

I want to thank you as well for taking your time to help me! 

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