Forum Discussion

vmurali1's avatar
vmurali1
Frequent Visitor
3 years ago
Solved

Requesting help with DAX Calculation

Team,  I have a matrix where i am trying to calculate cost per case. The formula for that would be - Total Product Cost / Total# of Cases. I created two measures. One to sum the total product cost a...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hello vmurali1 if you want the #cases to be constant by year, you can try to first create a new column year with formula

    Year= YEAR(table[case date])

    Then create a new measure

    # cases by year = Calculate(distinctcount[column you want],allexcept(table,table[Year]))

  • Anonymous's avatar
    Anonymous
    3 years ago

    If you want the # cases by year according to column "name" then just do 

     

    # cases by year = Calculate(count(table[name],allexcept(table,table[Year],table[name]))