Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
P_P2595
Helper I
Helper I

Need to create subtotal column after each row of provider

Hi Team,

I am looking to achieve the following output in Power BI by adding a calculated column or measure. Specifically, I need to create a subtotal row after each provider and sum the values for the last three columns. The last three columns are calculated as follows:

  1. @Indirect Session Total (Min):

    @Indirect Session Total (Min) = CALCULATE( SUM('PROGRESS NOTE'[INDIRECT TIME]), CONTAINSSTRING('PROGRESS NOTE'[PN TYPE], "NDIS"), ALLEXCEPT('PROGRESS NOTE', 'PROGRESS NOTE'[MRN], 'PROGRESS NOTE'[PROVIDER]) )
  2. TOTAL 180:

    TOTAL 180 = CALCULATE( 180, ALLEXCEPT('PROGRESS NOTE', 'PROGRESS NOTE'[MRN], 'PROGRESS NOTE'[PROVIDER]) )
  3. BALANCE:

    DAX
    BALANCE = [TOTAL 180] - [@Indirect Session Total (Min)]


Input:

MRNCLIENT FULLNAMEPROVIDERSPECIALITYCASE FIRST VISIT DATE@Indirect Session Total (Min)TOTAL 180


BALANCE
1JCO 20180160
2CCO08/07/2024 0:0015018030
3GES05/08/2024 0:0030180150
4JHS 15180165
5EHS26/08/2024 0:005180175



Output:

MRNCLIENT FULLNAMEPROVIDERSPECIALITYCASE FIRST VISIT DATE@Indirect Session Total (Min)TOTAL 180BALANCE
1JCO 20180160
2CCO08/07/2024 0:0015018030
SUBTOTAL    170360190
3GES05/08/2024 0:0030180150
SUBTOTAL    30180150
4JHS 15180165
5EHS26/08/2024 0:005180175
SUBTOTAL    20360340

 

Is it possible to achieve this in Power BI? I would appreciate any guidance on how to implement this.

Thank you!

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @ P_P2595,


You can display data using Matrix visualization.

 

Put /PROVIDER/ and other columns in the row options.

Put the /@Indirect Session Total (Min)/, /TOTAL/, and /BALANCE/ columns into the Value option.

Matrix Vision sums the last three column values for each Provider group.

vdengllimsft_0-1725259117954.png

 

Best Regards,

Dengliang Li

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Thejeswar
Super User
Super User

@P_P2595 ,

You can get this view in the matrix in a straight forward fashion when we change the ordering of the columns.

And Row Subtotals should be enabled only for Provider and Speciality

Thejeswar_0-1725262510726.png

Regards,

Anonymous
Not applicable

Hi @ P_P2595,


You can display data using Matrix visualization.

 

Put /PROVIDER/ and other columns in the row options.

Put the /@Indirect Session Total (Min)/, /TOTAL/, and /BALANCE/ columns into the Value option.

Matrix Vision sums the last three column values for each Provider group.

vdengllimsft_0-1725259117954.png

 

Best Regards,

Dengliang Li

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors