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

Calculate the % of the sum of a selection - if that makes any sense:)

Hi,
I have a column that contains about 10 categories, two of them are "Ambulante Begeleiding" and "Begeleiding Wijkteam". I am trying to calculate the %-"Begeleiding Wijkteam" of the total of the two. So if i look at Februari 2020 (please find table below) i have 148/(148+27)= 85% but the formula now calculates 148/162 = 91%
 
There are 162 distinct customers but 175 customers if you add the two seperate categories. I need the 175, how do i get that?
 
I tried a regular count but then (if you at the second table) the correction within the categorie also disappears, and that is the most important one for the data.
 
Hopefully an easy question, and thanks in advance for helping me out!
 
% begeleiding = DIVIDE(CALCULATE([# Distinct Active customers];FILTER(bron;bron[Categorie] = "Begeleiding Wijkteam"));CALCULATE([# Distinct Active customers]; FILTER(bron;bron[Categorie] IN {"Begeleiding Wijkteam"; "Ambulante begeleiding"})))
 
 

Overview customers.png

 
 
2 REPLIES 2
v-lid-msft
Community Support
Community Support

Hi @TijmenJDekkers ,

 

 

We can use the following measure to meet your requirement.

 

% begeleiding =
DIVIDE (
   CALCULATE ( [# Distinct Active customers]),
    CALCULATE (
       SUMX (CALCULATETABLE( VALUES ( 'Table'[Categorie] ),ALLSELECTED('Table')),  CALCULATE([# Distinct Active customers]))
      )
)

 

Then we can get the result like this,

 

34.png


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi,
Thanks for helping! Only thing is that It also returns the same (91%, instead of 84%) as i get from my measure.. 

 

I added your measure and then filtered the visual for the 2 categories.

 

Did i do something wrong?

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.