Earn recognition and rewards for your Microsoft Fabric Community contributions and become the hero our community deserves.
Learn moreBecome a Certified Power BI Data Analyst! Prepare for Exam PL-300 with expert-led live sessions. Get registered!
Hi, I want to be able to show the % of incidents per location on a card that changes with a location dropdown slicer. For example, there were 12 incidents last year, when I click Liverpool on the slicer, I want the card to show 16.6%, if I click Manchester = 25%.. and so on. I have the Incident_Count measure, but how would the rest be done, please?
Incident | Date | Location |
1 | 01/04/2024 | Liverpool |
2 | 04/04/2024 | Liverpool |
3 | 21/05/2024 | Manchester |
4 | 26/05/2024 | Blackpool |
5 | 27/05/2024 | Edinburgh |
6 | 03/06/2024 | Edinburgh |
7 | 07/07/2024 | Manchester |
8 | 08/07/2024 | Glasgow |
9 | 09/08/2024 | Manchester |
10 | 11/09/2024 | Blackpool |
11 | 20/10/2024 | Edinburgh |
12 | 22/10/2024 | Glasgow |
You can create a measure like
Location Incident % =
VAR CurrentLocationCount =
COUNTROWS ( 'Table' )
VAR TotalCount =
CALCULATE ( COUNTROWS ( 'Table' ), REMOVEFILTERS ( 'Table'[Location] ) )
VAR Result =
DIVIDE ( CurrentLocationCount, TotalCount )
RETURN
Result
Set it to be formatted as a %.
Hi @johnt75, I've tried this multiple times but it keeps giving me a value of 100% for each location. Any ideas why that could be please?
User | Count |
---|---|
78 | |
67 | |
56 | |
50 | |
46 |
User | Count |
---|---|
49 | |
48 | |
39 | |
32 | |
32 |