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

Become a Certified Power BI Data Analyst! Prepare for Exam PL-300 with expert-led live sessions. Get registered!

Reply
RichOB
Post Patron
Post Patron

How to turn this table into %'s that change with a slicer

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? 

 

 

IncidentDateLocation
101/04/2024Liverpool
204/04/2024Liverpool
321/05/2024Manchester
426/05/2024Blackpool
527/05/2024Edinburgh
603/06/2024Edinburgh
707/07/2024Manchester
808/07/2024Glasgow
909/08/2024Manchester
1011/09/2024Blackpool
1120/10/2024Edinburgh
1222/10/2024Glasgow

 

3 REPLIES 3
johnt75
Super User
Super User

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?

If you put it in a table with the Location field it should work. See attached.

Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

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

May 2025 Monthly Update

Fabric Community Update - May 2025

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