Forum Discussion

MikeyD's avatar
MikeyD
Frequent Visitor
4 years ago

Dax Help

Hi All,

 

I was hoping you could help me on creating a Dax Expression as i'm new to DAX Commands.

 

I'm trying to Filter out a specific name in column called 'Intervention' and another name in 'Population' and return a percentage based on a GroupCount column. So far I have this but it's not returning the percent that i'm expecting:

 
VAR RN = SUMX(Filter(Spreadsheetname,Spreadsheetname[Population]= "Local" && Spreadsheetname[Intervention] = "Jab"),SpreadsheetName[Indate])
VAR GP = SUMX(Filter(Spreadsheetname,Spreadsheetname[Population]= "Local"), Spreadsheetname[GroupCount])
Return
(RN / GP)
 
Is this right or is there a better way that will work?

6 Replies

  • Please provide sanitized sample data that fully covers your issue. I can only help you with meaningful sample data.
    Please paste the data into a table in your post or use one of the file services like OneDrive or Google Drive. Screenshots of your source data are not useful.
    Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

    https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
    https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

  • MikeyD's avatar
    MikeyD
    Frequent Visitor

    Basically i'm trying to use a group count (thousands of lines) / Metric met for this particular vaccine to get an overall percentage of those that have and haven't met the metric.

    There are 24 other vaccines inside vaccination name that need to be filtered out.

    InterventionNameServiceGroupCountVaccinatedNotVaccinatedVaccinationUnknownMetricMetric Not Met
    TyphoidRAF110001
    TyphoidRN330012
    TyphoidRN330012
    TyphoidRN220011
    TyphoidRN110001
    TyphoidRN110010
    TyphoidRN440004
    TyphoidRN220002
    TyphoidRN110010
    TyphoidRN110010
    TyphoidRN110010
    TyphoidRAF110001
    TyphoidRAF110001
    TyphoidRAF110001
    TyphoidRN110001
    TyphoidRAF110001
    TyphoidRAF220002
    TyphoidRAF110001
    TyphoidRN220002
    TyphoidRN220002
    TyphoidRN110001
    TyphoidRAF440013
    TyphoidRAF110001
    TyphoidRN110001
    TyphoidRN110001
    TyphoidRAF110001
    TyphoidRAF110001
    TyphoidRAF110001
      • MikeyD's avatar
        MikeyD
        Frequent Visitor

        A percentage based only those RN who have and Haven't met the Metric including the Unknowns