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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Percentage with COUNT measure excluding page filtering

My table shows each file's name and type like so, and there are no duplicates:
_____________________________
FileName          |    FileType
------------------------------
cloudimage            jpg
annualreport          pdf

monthlyreport       pdf
catvideo                 mp4

geodata                 json

My report has two visuals:
1) Horizontal bar chart showing how many files of each type are in the table.
2) Card showing a percentage.

 

EXPECTED RESULTS
When all the bars are selected, the card should show 100%
When I select the bar for PDF, the card should show 40%
When I select all bars except jpg, the card should show 80%

I successfully created this measure to count the occurence of each filetype (which are text data)

MeasureA = (COUNT('Table'[FileType]))
 

I have unsuccessfully tried creating a second measure to use for the card visual, such as:

percentageMeasure = [MeasureA]/COUNTROWS('Table')


I tried everything I could think of: DIVIDE, CALCULATE, ALL, REMOVEFILTERS, EXCEPTALL, COUNTROWS but I can't find how to ignore the page filtering and display the correct percentage in the card. I only get:
1) 100% all the time - because 2 pdf files / 2 pdf files = 1
2) Error message about 'paramater is not the correct type', expecting a number, expecting a string, or 'cannot be found or may not be used.'

 

How can I get this card to show the correct percentage?

1 ACCEPTED SOLUTION
gmsamborn
Super User
Super User

Hi @Anonymous 

 

Would a measure like this help?

 

Pct = 
    DIVIDE(
        COUNT( 'Table'[FileName] ),
        CALCULATE(
            COUNT( 'Table'[FileName] ),
            ALL( 'Table' )
        )
    )

 

 

Let me know if you have any questions.

 

splambo2.pbix

 



Proud to be a Super User!

daxformatter.com makes life EASIER!

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@gmsamborn You beat me to the answer by a minute 🙂 Thank you!
It also works with REMOVEFILTERS instead of ALL.

gmsamborn
Super User
Super User

Hi @Anonymous 

 

Would a measure like this help?

 

Pct = 
    DIVIDE(
        COUNT( 'Table'[FileName] ),
        CALCULATE(
            COUNT( 'Table'[FileName] ),
            ALL( 'Table' )
        )
    )

 

 

Let me know if you have any questions.

 

splambo2.pbix

 



Proud to be a Super User!

daxformatter.com makes life EASIER!

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.