Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Percentage calculation

Hi all,                              Pecentage calculation need to do for the report . Calcualtion is for state with CA only. Percenatge=( sum(value)/2000)*100 2000(constant value )     ...
  • djurecic's avatar
    3 years ago

    Hi Anonymous ,

     The measures below are one way to do this. You could combine the measures together in a single measure.

    Please consider accepting as solution if this answers the question.

     
    CA Total = CALCULATE(SUM(Table_[value]), FILTER(ALL(Table_),Table_[state]="CA"))
    --This is the total value of all "CA" state rows
     
    CA Value = CALCULATE(SUM(Table_[value]), FILTER(Table_,Table_[state]="CA"))
    --This is the row value where state= "CA"
     
    CA Percentage = DIVIDE([CA Value],[CA Total],0)
    --This gets the percentage