Hello
I'm trying to write a PowerPivot DAX formula to get the percentage of total based on a subcategory. Ideally I'd like to click on a slicer and have to formula automatically calculate the % of total. It seems like an easy formula, however I've not been able to get it to work. Below is the formula I've been trying to get to work. Any help would be greatly appreciated! I've included a link to the file.
% of Total= CALCULATE([Sum of Runs],Table1,Table1[Sub Category]=[Sub Category])
Example Data:
[TABLE="width: 316"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD]League[/TD]
[TD]Team[/TD]
[TD]Sub Category[/TD]
[TD]Runs[/TD]
[/TR]
[TR]
[TD]National[/TD]
[TD]Atlanta[/TD]
[TD]NL East[/TD]
[TD="align: right"]43[/TD]
[/TR]
[TR]
[TD]National[/TD]
[TD]Philadelphia[/TD]
[TD]NL East[/TD]
[TD="align: right"]16[/TD]
[/TR]
[TR]
[TD]National[/TD]
[TD]Pittsburgh[/TD]
[TD]NL Central[/TD]
[TD="align: right"]46[/TD]
[/TR]
[TR]
[TD]National[/TD]
[TD]St Louis[/TD]
[TD]NL Central[/TD]
[TD="align: right"]12[/TD]
[/TR]
[TR]
[TD]National[/TD]
[TD]Arizona[/TD]
[TD]NL West[/TD]
[TD="align: right"]30[/TD]
[/TR]
[TR]
[TD]American[/TD]
[TD]Seattle[/TD]
[TD]AL West[/TD]
[TD="align: right"]33[/TD]
[/TR]
[TR]
[TD]National[/TD]
[TD]Washington[/TD]
[TD]NL East[/TD]
[TD="align: right"]12[/TD]
[/TR]
[TR]
[TD]National[/TD]
[TD]Miami[/TD]
[TD]NL East[/TD]
[TD="align: right"]34[/TD]
[/TR]
</tbody>[/TABLE]
I'm trying to write a PowerPivot DAX formula to get the percentage of total based on a subcategory. Ideally I'd like to click on a slicer and have to formula automatically calculate the % of total. It seems like an easy formula, however I've not been able to get it to work. Below is the formula I've been trying to get to work. Any help would be greatly appreciated! I've included a link to the file.
% of Total= CALCULATE([Sum of Runs],Table1,Table1[Sub Category]=[Sub Category])
Example Data:
[TABLE="width: 316"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD]League[/TD]
[TD]Team[/TD]
[TD]Sub Category[/TD]
[TD]Runs[/TD]
[/TR]
[TR]
[TD]National[/TD]
[TD]Atlanta[/TD]
[TD]NL East[/TD]
[TD="align: right"]43[/TD]
[/TR]
[TR]
[TD]National[/TD]
[TD]Philadelphia[/TD]
[TD]NL East[/TD]
[TD="align: right"]16[/TD]
[/TR]
[TR]
[TD]National[/TD]
[TD]Pittsburgh[/TD]
[TD]NL Central[/TD]
[TD="align: right"]46[/TD]
[/TR]
[TR]
[TD]National[/TD]
[TD]St Louis[/TD]
[TD]NL Central[/TD]
[TD="align: right"]12[/TD]
[/TR]
[TR]
[TD]National[/TD]
[TD]Arizona[/TD]
[TD]NL West[/TD]
[TD="align: right"]30[/TD]
[/TR]
[TR]
[TD]American[/TD]
[TD]Seattle[/TD]
[TD]AL West[/TD]
[TD="align: right"]33[/TD]
[/TR]
[TR]
[TD]National[/TD]
[TD]Washington[/TD]
[TD]NL East[/TD]
[TD="align: right"]12[/TD]
[/TR]
[TR]
[TD]National[/TD]
[TD]Miami[/TD]
[TD]NL East[/TD]
[TD="align: right"]34[/TD]
[/TR]
</tbody>[/TABLE]