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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Measure to calculate a static line disappears when filter selected and calculate a KPI

Hi, 

 

I have 2 questions around the thing I'm trying to do. 
I have measure which is correct which calculates the coverage (%) for those with a certain column value: 

CCG Screening Coverage = DIVIDE(
CALCULATE(
SUM('Screening'[Eligible]),'Screening'[Area Code] = "E38000068"),
CALCULATE(
SUM('Screening'[Screened]), 'Screening'[Area Code] = "E38000068")
)
This should be static as the area average however when I choose a smaller area on a slicer within that area the line disappears and I'd like it to stay put.


also, I'm trying to calcualte the number of people needed in order to reach a target. I have a Switch statement :
Screening Target = SWITCH(
SELECTEDVALUE('Cancer Screening'[Screening Type]),
"Cervical Cancer", .8,
"Bowel Cancer", .6,
"Breast Cancer", .7
which changes a static line depending on what value is picked to show a target %. 

 I want a measure to multiple the above by those Eligible, take that figure away from those actually screened, to then leave me with the value I need. 

any ideas? 
1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

Hi, @Anonymous 

If you want the constant line to be unaffected by slicers, it is recommended to use the ALL function  to ignore any filters that might have been applied. 

CCG Screening Coverage =
DIVIDE (
    CALCULATE (
        SUM ( 'Screening'[Eligible] ),
        FILTER ( ALL ( 'Screening' ), 'Screening'[Area Code] = "E38000068" )
    ),
    CALCULATE (
        SUM ( 'Screening'[Screened] ),
        FILTER ( ALL ( 'Screening' ), 'Screening'[Area Code] = "E38000068" )
    )
)

Best Regards,
Community Support Team _ Eason

View solution in original post

1 REPLY 1
v-easonf-msft
Community Support
Community Support

Hi, @Anonymous 

If you want the constant line to be unaffected by slicers, it is recommended to use the ALL function  to ignore any filters that might have been applied. 

CCG Screening Coverage =
DIVIDE (
    CALCULATE (
        SUM ( 'Screening'[Eligible] ),
        FILTER ( ALL ( 'Screening' ), 'Screening'[Area Code] = "E38000068" )
    ),
    CALCULATE (
        SUM ( 'Screening'[Screened] ),
        FILTER ( ALL ( 'Screening' ), 'Screening'[Area Code] = "E38000068" )
    )
)

Best Regards,
Community Support Team _ Eason

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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