Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe'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
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 @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.
@gmsamborn You beat me to the answer by a minute 🙂 Thank you!
It also works with REMOVEFILTERS instead of ALL.
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.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 52 | |
| 38 | |
| 37 | |
| 19 | |
| 18 |
| User | Count |
|---|---|
| 67 | |
| 67 | |
| 34 | |
| 32 | |
| 29 |