Search code examples
powerbi

How can I create a card or other visual please in Power Bi showing a percentage where the number of days is less than 3


I have a calculated column with a list of number of days calculated showing the time of referral to admission for several hospitals. I need to show separate guages for each hospital or another visual to show the percentage of admissions that occurred within 3 days from referral for each hospital. I have tried several measures using calculate and count but cannot get this right. Can anyone help please with the following:

Total referrals for each hospital % of admissions <= 3 days

I have tried the following:

Percentage =
DIVIDE (
    COUNT ( 'column'[DateOfReferral] ),
    SUM ( 'reporting CCAdmission'[Waiting Time] ) <= 3,
    "0.00%"
)

Solution

  • without your code i can't do that much but this is a guess i can do:

    TotalReferrals = COUNT('column'[DateOfReferral])
    
    AdmissionsWithin3Days = 
    CALCULATE (
        COUNTROWS('reporting CCAdmission'),
        'reporting CCAdmission'[Waiting Time] <= 3
    )
    
    PercentageWithin3Days = 
    DIVIDE ( [AdmissionsWithin3Days], [TotalReferrals], 0 )