Dynamic percentage change with filters in Powerbi

Viewed 569

I have a table that have ID, date, type of injuries. I am trying to Find the percentage of each affected body part with the ability to filter the year. I used the following Measures:

INJURIES COUNT = 
IF(
    ISBLANK ( COUNT( 'Injuries'[ID] ) ), 
    0, 
    COUNT( ( 'Injuries'[ID]) )
)

Injuries percentage = 
DIVIDE(
    Injuries[INJURIES COUNT], 
    CALCULATE(
        Injuries[INJURIES COUNT], 
        ALLSELECTED()
    )
    ,0
)

When I show the data in a table it works just fine even when I filter the year: Data in table looks Ok

When I try to use it in a card visual it only show me 100% even if I filtered the body part and the year: Percentage on Card visual

How can I fix it? I tried many different solutions but nothing worked.

1 Answers

Can you try this below measure (For CARD presentation only)-

Injuries percentage = 
DIVIDE(
    Injuries[INJURIES COUNT], 
    CALCULATE(
        Injuries[INJURIES COUNT], 
        ALL(Injuries)
    )
    ,0
)
Related