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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
tsunamisabella
Frequent Visitor

Create a dynamic column subtotal measure

Hello! I want create a measure [Subtotal] to retrieve the column subtotal (subtotal of the selected period) which can be dyanically changed along the selected column dimension [Period]. Note that [Period] is both the column dimension and a filter.

 

I created a measure below, however, in the pivot table, this [Subtotal] returns the grand total, instead of column subtotal per customer segment:

 

Subtotal = CALCULATE(
[a_measure],
ALLEXCEPT(table_name, table_name[Period])
)

 

 

 

[Period]2023-01 2023-02 2023-03  
[Customer]ValueSubtotalValueSubtotalValueSubtotalColumn Subtotal
Segment 11151151153
Segment 22152152156
Segment 33153153159
Segment 441541541512
Segment 551551551515

 

My goal it to have:

(1)  the measure summarize the column subtotal at each row dimension

[Period]2023-01 2023-02 2023-03  
[Customer]ValueSubtotalValueSubtotalValueSubtotalColumn Subtotal
Segment 11313133
Segment 22626266
Segment 33939399
Segment 441241241212
Segment 551551551515

(2) subtotal chanegs along [Period] selected, for exmaple, if I unselect 2023-03, the following table should return correct value:

[Period]2023-01 2023-02
[Customer]ValueSubtotalValueSubtotalColumn Subtotal
Segment 112122
Segment 224244
Segment 336366
Segment 448488
Segment 551051010

 

Can you help me correct my measure? Thank you in advance!

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @tsunamisabella 

Please try

Subtotal =
CALCULATE ( [a_measure], ALLSELECTED ( table_name[Period] ) )

View solution in original post

2 REPLIES 2
tamerj1
Super User
Super User

Hi @tsunamisabella 

Please try

Subtotal =
CALCULATE ( [a_measure], ALLSELECTED ( table_name[Period] ) )

OMG! Thank you for the swift reply and the simply & wonderful solution 🥰!

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.