Forum Discussion

krlowe's avatar
krlowe
New Member
1 year ago
Solved

New DAX measure filtering by distinct count and two numeric variables

Hi folks, I'm trying to create a percentile calculation in the end, but here are some details. Table name=DTaP Need to create new metric called "Vaccine at 2 Months" with the following filtering: ...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Thanks for rsbin and Kedar_Pande's concern about this issue.

      

    Hi, krlowe 

    I am glad to help you.

     

    Based on your description and the suggestions of others, I have created a simple pbix file that I hope will help you.

     

    First, since you didn't give any test data, I created some of my own for testing:

     


    Then create a Measure Vaccine at 2 Months:

    Vaccine at 2 Months = 
    CALCULATE(
        DISTINCTCOUNT(DTaP[ID]),
        DTaP[AgeMonths] <= 2,
        DTaP[OrdinalPosition] = 1
    )


    Output:

     

    I have attached this pbix file below, hope it helps you.

     

     

    I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
    Best Regards,
    Fen Ling,
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.