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

View all the Fabric Data Days sessions on demand. View schedule

Reply
amit_maurya
New Member

Adding Totals to Matrix visual

Power BI view.PNG

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @amit_maurya ,

I created some data:

vyangliumsft_0-1704093313061.png

 

 

Here are the steps you can follow:

1. Create calculated table.

Table 2 =
SUMMARIZE(
    'Table','Table'[Group],'Table'[Month],'Table'[Value])

vyangliumsft_1-1704093313063.png

Table 3 =
var _today=TODAY()
var _table=
SUMMARIZE(
    'Table 2',
    'Table 2'[Group],
    "Month","YTD Total",
    "Value",
    SUMX(FILTER(ALL('Table'),'Table'[Group]=EARLIER('Table 2'[Group])&&'Table'[Date]>=DATE(2022,7,1)&&'Table'[Date]<DATE(2023,3,1)),'Table'[Value]))
return
UNION(
    'Table 2',_table)

vyangliumsft_2-1704093336124.png

Table 4 =
var _today=TODAY()
var _table=
SUMMARIZE(
    'Table 3',
    'Table 3'[Group],
    "Month","YTD To Go Total",
    "Value",
    SUMX(FILTER(ALL('Table'),'Table'[Group]=EARLIER('Table 3'[Group])&&'Table'[Date]>=DATE(2023,3,1)&&'Table'[Date]<DATE(2023,7,1)),'Table'[Value]))
return
UNION(
    'Table 3',_table)

vyangliumsft_3-1704093336125.png

2. Create measure.

Measure =
IF(
    HASONEVALUE('Table 4'[Month]),MAX('Table 4'[Value]),
    SUMX(
        FILTER('Table 4',
        'Table 4'[Month] in {"YTD Total","YTD To Go Total"}),[Value]))

3. Matrix visual – Column subtotals – Column -- Modify Characters “Grand Total”.

vyangliumsft_4-1704093384250.png

4. Result:

 

vyangliumsft_5-1704093384255.png

 

Best Regards,

Liu Yang

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
Anonymous
Not applicable

Hi  @amit_maurya ,

I created some data:

vyangliumsft_0-1704093313061.png

 

 

Here are the steps you can follow:

1. Create calculated table.

Table 2 =
SUMMARIZE(
    'Table','Table'[Group],'Table'[Month],'Table'[Value])

vyangliumsft_1-1704093313063.png

Table 3 =
var _today=TODAY()
var _table=
SUMMARIZE(
    'Table 2',
    'Table 2'[Group],
    "Month","YTD Total",
    "Value",
    SUMX(FILTER(ALL('Table'),'Table'[Group]=EARLIER('Table 2'[Group])&&'Table'[Date]>=DATE(2022,7,1)&&'Table'[Date]<DATE(2023,3,1)),'Table'[Value]))
return
UNION(
    'Table 2',_table)

vyangliumsft_2-1704093336124.png

Table 4 =
var _today=TODAY()
var _table=
SUMMARIZE(
    'Table 3',
    'Table 3'[Group],
    "Month","YTD To Go Total",
    "Value",
    SUMX(FILTER(ALL('Table'),'Table'[Group]=EARLIER('Table 3'[Group])&&'Table'[Date]>=DATE(2023,3,1)&&'Table'[Date]<DATE(2023,7,1)),'Table'[Value]))
return
UNION(
    'Table 3',_table)

vyangliumsft_3-1704093336125.png

2. Create measure.

Measure =
IF(
    HASONEVALUE('Table 4'[Month]),MAX('Table 4'[Value]),
    SUMX(
        FILTER('Table 4',
        'Table 4'[Month] in {"YTD Total","YTD To Go Total"}),[Value]))

3. Matrix visual – Column subtotals – Column -- Modify Characters “Grand Total”.

vyangliumsft_4-1704093384250.png

4. Result:

 

vyangliumsft_5-1704093384255.png

 

Best Regards,

Liu Yang

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

PijushRoy
Super User
Super User

Hi @amit_maurya 

Please create measure for July, Aug, Sep, Oct, Nov, Dec, Jan, Feb, Mar, April, May & June
Then create measure for YTD Total = July+...+Feb
YTD to Go = Mar + June
Grand Total = YTD Total + YTD to go

Bring all measure in Matrix table Value field




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors