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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
IlMoro
Helper II
Helper II

Show percentage of a number of items (same name) in a column compared with the total number of items

Hi,

 

taking in consideration just one column in my db, composed by standard names (es: dept1, dept2, dept3, dept1, dept1, dept3) repeated several times in the column, I would like to display the percentage of one of them compared to the total amount of them (ex: the percentage of dept1 in the test reported above is 50%).

 

M_SumRCAOwn = 
CALCULATE(
    DIVIDE(COUNT(RootCauses[DEPTID]), COUNT(RootCauses[DEPTID])))
It displays "1" in the card visualization but I need to find the way to filter the denominator just for a particular name (ex: "dept1").
Then I have to figure out how to display a % instead of a number.
 
Thanks for any help.
1 ACCEPTED SOLUTION
VahidDM
Super User
Super User

Hi @IlMoro 

 

Try this:

Measure = 
VAR _A =
    CALCULATE(
        COUNTA( 'Table'[names] ),
        FILTER( ALL( 'Table' ), 'Table'[names] = "dept1" )
    )
VAR _B =
    CALCULATE( COUNTA( 'Table'[names] ), ALL( 'Table' ) )
RETURN
    _A / _B

 

Outpur:

VahidDM_0-1638448957537.png

 

Data I used:

VahidDM_1-1638448983742.png

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @IlMoro,

Did VahidDM 's suggestions help with your scenario? if that is the case, you can consider Kudo or accept his suggestions to help others who faced similar requirements.

If that also doesn't help, please share more detailed information to help us clarify your scenario to test.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

VahidDM
Super User
Super User

Hi @IlMoro 

 

Try this:

Measure = 
VAR _A =
    CALCULATE(
        COUNTA( 'Table'[names] ),
        FILTER( ALL( 'Table' ), 'Table'[names] = "dept1" )
    )
VAR _B =
    CALCULATE( COUNTA( 'Table'[names] ), ALL( 'Table' ) )
RETURN
    _A / _B

 

Outpur:

VahidDM_0-1638448957537.png

 

Data I used:

VahidDM_1-1638448983742.png

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

Hi VahidDM,

Great work! I need some clarification, your measure display the value of "dept1" only. I know we can write different measure for other department.
My Query is can we display the result all dept on single measure. can we achieved this or Is there any other method.
Thank in advance.



Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.