Forum Discussion

Roskalnikov's avatar
Roskalnikov
Frequent Visitor
3 years ago
Solved

Writing Dax for Percentages based on Conditions

Hi everyone,   I'm having trouble figuring out the apporpirate formula to calculate the below: (Sum of number of practitioners for year ranges < 1 year and 1-5 years)/(Sum of number of practitio...
  • ovde's avatar
    3 years ago

    Hi Roskalnikov,

     

    You could use SUMX and DIVIDE. Create a new measure as follows.

     

    Measure =

    VAR _Group1 = SUMX( FILTER(Table, Table[Years Intended to Work] <= 5), Table[Number of Practitioners])
    VAR _Group2 = SUMX( FILTER(Table, Table[Years Intended to Work] > 5 ), Table[Number of Practitioners])
    VAR _Division = DIVIDE( _Group1, _Group2)
    RETURN
    _Division * 100


    Hope this helps!