cancel
Showing results for 
Search instead for 
Did you mean: 

Percent of Total

Moderator
4318 Views
Highlighted
Moderator WillT
Moderator

Percent of Total

This measure returns the % contribution of the current value to the total for a particular category

 

Name:

% contribution

Description:

Calculate the percent that a value contributes to a parent category

Parameters:

Name: Base value

Tooltip: The value you want to see the percent for

Type: Numerical field / measure

 

Name: Category

Tooltip: The category you want the overall total for

Type: Date field

 

DAX:


{Base Value} as % of {Category} total =
VAR __BASE_VALUE =
  {Base Value}
VAR __TOTAL_VALUE =
  CALCULATE({Base Value}, ALL({Category}))
RETURN
  IF(
   NOT ISBLANK(__BASE_VALUE),
   DIVIDE(__BASE_VALUE, __TOTAL_VALUE)
  )