Calculate Grouped Percentages in Power BI with DAX
Question details
Calculate row percentages using different group subtotal denominators, then compare each group subtotal with an overall total.

- Product
- Microsoft Power BI
- Device & OS
- not provided
- Scenario
- A report contains groups whose detail rows must be divided by their respective subtotals, while group totals must be divided by an overall total.
- Observed behavior
- Each detail row should show its share of the appropriate group total, and each group total should show its share of the overall total.
Identify which value is the subtotal for each group and which value is the overall total, such as the values represented by G12, G16, and G17 in the source workbook. Use meaningful group keys rather than relying on spreadsheet cell addresses in Power BI.
Create DAX measures for group and overall percentages
Use separate measures when detail rows and group totals require different denominators.
This example assumes a Data table with Group and Amount columns, a separate Group Totals table with one Group and Total value per group, and an Overall Total table containing one Total value. Keep subtotal and grand total rows out of Data so they are not counted as detail amounts.
The denominator tables in this example hold fixed imported totals. If denominators must change with report filters, calculate them from the detail data instead and define which filters each calculation should retain.
In Power BI Desktop, select Home > Transform data and arrange the source into Data, Group Totals, and Overall Total tables. Ensure each group key occurs only once in Group Totals, then select Close & Apply.
Select Modeling > New measure and enter: Detail Amount = SUM('Data'[Amount]).
Select Modeling > New measure and enter: Row % of Group = VAR GroupKey = SELECTEDVALUE('Data'[Group]) VAR GroupTotal = LOOKUPVALUE('Group Totals'[Total], 'Group Totals'[Group], GroupKey) RETURN DIVIDE([Detail Amount], GroupTotal). Replace the example table and column names with your own.
Select Modeling > New measure and enter: Group % of Overall = VAR GroupKey = SELECTEDVALUE('Data'[Group]) VAR GroupTotal = LOOKUPVALUE('Group Totals'[Total], 'Group Totals'[Group], GroupKey) VAR OverallTotal = SELECTEDVALUE('Overall Total'[Total]) RETURN DIVIDE(GroupTotal, OverallTotal).
Add Group and a detail-row identifier to a table or matrix visual. Add Row % of Group for detail rows and Group % of Overall for group-level display; select each measure and use Measure tools > Format > Percentage.
Review grouped percentage data in WPS Spreadsheets
WPS Office is a free, lightweight alternative for reviewing and preparing spreadsheet data in a familiar interface. Open compatible Excel workbooks as part of a straightforward migration, then use Power BI for the DAX measures described above.

Frequently Asked Questions
How do I use different denominators for different groups?
Store one subtotal for each group in a Group Totals table. In a DAX measure, use SELECTEDVALUE to identify the current group, LOOKUPVALUE to retrieve its subtotal, and DIVIDE to calculate the percentage.
Why does my percentage measure return blank?
Check that the visual has a single group in context, the group key matches a row in Group Totals, and the denominator is not blank or zero. SELECTEDVALUE and DIVIDE can return blank when those conditions are not met.
Will the imported group totals change when I apply a report filter?
Not necessarily. The example uses fixed values retrieved from a separate totals table. To make denominators respond to filters, create measures that calculate the totals from detail data and specify which filters to retain.
Can Power Query calculate these percentages instead?
Yes. In Home > Transform data, you can group or merge data to bring each subtotal onto its detail rows, then use Add Column > Custom Column to divide by that subtotal. These values are calculated during data refresh rather than dynamically for report filters.
How do I show the results as percentages?
Select a percentage measure in the Fields or Data pane, then choose Measure tools > Format > Percentage. Set the desired decimal places in the same formatting controls.




