Forum Discussion

Gingerjeans88's avatar
Gingerjeans88
Helper IV
6 years ago
Solved

DAX Measure help! % calculation

Hello hello helpful folk,    I need a little help with a measure.  I'll give you the high level requirement then explain table structure:   I need to be able to calculate the % of college applic...
  • mahoneypat's avatar
    6 years ago

    Here is one way to approach this one

     

    % Students Career Day First =
    VAR __summarytable =
        ADDCOLUMNS (
            VALUES ( Students[StudentID] ),
            "@AppDate", CALCULATE ( MIN ( Applications[Date] ) ),
            "@MinCareerDay", CALCULATE ( MIN ( Events[Date] ), Events[Type] = "Careers Day" )
        )
    RETURN
        DIVIDE (
            COUNTROWS ( FILTER ( __summarytable, [@MinCareerDay] < [@AppDate] ) ),
            COUNTROWS ( __summarytable )
        )

     

    If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

    Regards,

    Pat