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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
TSGD2123
Helper I
Helper I

Totals by second level of a matrix's column

Hello all,

 

I have a matrix like this:

 

ColField            ColValue1                 ColValue2                 ColValue3                TOTAL

RowFiled          Open1  Open 2         Open1  Open 2        Open1  Open 2       Open1  Open 2

RowValue1       1           3                   6           4                               3                7           10

RowValue2       2           4                   6                               2           1                10         5

RowValue3       5           2                   2           2                               2                9           13

 

I'm asked to include in it a Totals column at he end like in the example in red, that is,  totals by the second level of columns in the matrix, which are always the same since it's from an aux table: 

OpenedInterval =
DATATABLE(
    "Interval", STRING,
    {
        {"Open1"},
        {"Open2"}
    }
)
 
Thanks a lot in advance

 

2 ACCEPTED SOLUTIONS
DataNinja777
Super User
Super User

Hi @TSGD2123 ,

 

It appears the visual you want to achieve is not easily doable using one measure in the values field of the matrix table.  Even though it is not the most scalable way to do it, you can generate the visual you want by creating two separate measures for Open1 and Open2.  

DataNinja777_0-1762261547816.png

I have attached an example pbix file for your reference.

 

Best regards, 

 

View solution in original post

Praful_Potphode
Responsive Resident
Responsive Resident

Hi @TSGD2123 

Try Creating below 2 measures and add them in the end:

Total Open1 = 
CALCULATE(
    [Your Base Measure],
    ALLEXCEPT(
        OpenedInterval,
        OpenedInterval[Interval]
    ),
    OpenedInterval[Interval] = "Open1"
)
Total Open2 = 
CALCULATE(
    [Your Base Measure],
    ALLEXCEPT(
        OpenedInterval,
        OpenedInterval[Interval]
    ),
    OpenedInterval[Interval] = "Open2"
)

When you create matrix visual below should be the fields order:

 

  • Rows: RowField
  • Columns:
    • ColField
    • OpenedInterval[Interval]
  • Values:
    • Your Base Measure
    • Total Open1
    • Total Open2

Please give kudos or mark it as solution once confirmed.

 

Thanks and Regards,

Praful

 

 

View solution in original post

5 REPLIES 5
v-sgandrathi
Community Support
Community Support

Hi @TSGD2123

Thank you @Praful_Potphode@rampie@DataNinja777 , @parry2k for your responses for the query.

Has your issue been resolved?
If the response provided by the community member addressed your query, could you please confirm? It helps us ensure that the solutions provided are effective and beneficial for everyone.

If yes, kindly accept the useful reply as a solution and give us Kudos. It would be appreciated.
 

Thank you for your understanding!

Praful_Potphode
Responsive Resident
Responsive Resident

Hi @TSGD2123 

Try Creating below 2 measures and add them in the end:

Total Open1 = 
CALCULATE(
    [Your Base Measure],
    ALLEXCEPT(
        OpenedInterval,
        OpenedInterval[Interval]
    ),
    OpenedInterval[Interval] = "Open1"
)
Total Open2 = 
CALCULATE(
    [Your Base Measure],
    ALLEXCEPT(
        OpenedInterval,
        OpenedInterval[Interval]
    ),
    OpenedInterval[Interval] = "Open2"
)

When you create matrix visual below should be the fields order:

 

  • Rows: RowField
  • Columns:
    • ColField
    • OpenedInterval[Interval]
  • Values:
    • Your Base Measure
    • Total Open1
    • Total Open2

Please give kudos or mark it as solution once confirmed.

 

Thanks and Regards,

Praful

 

 

rampie
Advocate I
Advocate I

Hi @TSGD2123 

 

What you’re trying to achieve can be implemented in several ways, for example, using calculation groups or a more complex DAX measure. However, it really depends on how your data is structured.

 

The example you’re showing looks like the matrix visual you want to build in Power BI, but how does your raw data look, the dataset that feeds that matrix?


If you can share a sample or screenshot of the source data, I can help you write the measure

DataNinja777
Super User
Super User

Hi @TSGD2123 ,

 

It appears the visual you want to achieve is not easily doable using one measure in the values field of the matrix table.  Even though it is not the most scalable way to do it, you can generate the visual you want by creating two separate measures for Open1 and Open2.  

DataNinja777_0-1762261547816.png

I have attached an example pbix file for your reference.

 

Best regards, 

 

parry2k
Super User
Super User

@TSGD2123 it is not clear what you are looking for. Can you provide bit more detail, sample data, and any measures/relationships used, and the end goal?

 

Read this post to get your answer quickly.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.