Forum Discussion

sophie63's avatar
sophie63
Helper I
9 years ago
Solved

Percentage Matrix with subcategories

Hello,

 

i have troubles calculating percentages with subcategories. See below I would like in the 3rd column to calculate the % over the total net sales, but it's filtered per subcategories. How  can I solve that? See below the formulas I used

 

 

3rd column: Perc_Total_NetSales = var Totalvalue = SUMX(ALL(ViewReportingSummary[SalesSourceDesc]);
 CALCULATE(SUM(ViewReportingSummary[Net_Sales_Value])))
 return divide(SUM(ViewReportingSummary[Net_Sales_Value]); Totalvalue)

 

4th column:Perc_Total_NetSales_Tot = var Totalvalue = SUMX(ALL(ViewReportingSummary[Online Sales]);
 CALCULATE(SUM(ViewReportingSummary[Net_Sales_Value])))
 return divide(SUM(ViewReportingSummary[Net_Sales_Value]); Totalvalue)

  • Hi sophie63,

     

    Please try to modify the 3rd column DAX to below:

     

    Perc_Total_NetSales =
    var Totalvalue = CALCULATE(SUM(ViewReportingSummary[Net_Sales_Value]);ALL('ViewReportingSummary'))
     return
    divide(SUM(ViewReportingSummary[Net_Sales_Value]); Totalvalue)

     

     

    Best Regards,
    Qiuyun Yu

2 Replies

  • v-qiuyu-msft's avatar
    v-qiuyu-msft
    Community Support

    Hi sophie63,

     

    Please try to modify the 3rd column DAX to below:

     

    Perc_Total_NetSales =
    var Totalvalue = CALCULATE(SUM(ViewReportingSummary[Net_Sales_Value]);ALL('ViewReportingSummary'))
     return
    divide(SUM(ViewReportingSummary[Net_Sales_Value]); Totalvalue)

     

     

    Best Regards,
    Qiuyun Yu