Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
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)
I have unsuccessfully tried creating a second measure to use for the card visual, such as:
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?
Solved! Go to Solution.
Hi @splambo2
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.
@gmsamborn You beat me to the answer by a minute 🙂 Thank you!
It also works with REMOVEFILTERS instead of ALL.
Hi @splambo2
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.
Check out the April 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
102 | |
68 | |
46 | |
37 | |
37 |