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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
EstherBR
Helper III
Helper III

Matrix - Add a Row from another table

Hi,

 

I have the following matrix:

EstherBR_0-1758808869568.png

with the following data model:

EstherBR_1-1758808957166.png

 

The customer wants to add in the first row of the matrix the total sum of sales of Segment. The matrix should look like this:

 

EstherBR_2-1758809445446.png

Is it possible to do it? I can change the data model if necessary.

 

Thank you so much!

 

 

 

 

1 ACCEPTED SOLUTION

@EstherBR Here is an example that more or less aligns with what you are trying to do:

 

Create a table called "Categories":

CategorySort
Total Segment1
Dallas2
New York3
San Francisco4

 

Set the Sort column to be the Sort by column for Category.

 

Now create the following measure for use in your Matrix:

My Measure =
VAR _Category = MAX( 'Categories'[Category] )
VAR _Return =
  IF(
    _Category = "Total Segment",
    SUM( 'Cities'[Sales] )
    CALCULATE( SUM( 'Cities'[Sales] ), FILTER( 'Fact Table', [City] = _Category ) )
  )
RETURN _Return

 

Put the Category column from your Categories table as the rows to your matrix and My Measure as the Values.

View solution in original post

6 REPLIES 6
v-sdhruv
Community Support
Community Support

Hi @EstherBR ,

I hope the information provided above assists you in resolving the issue. If you have any additional questions, please feel free to reach out.


Thank You 

EstherBR
Helper III
Helper III

Thanks for your answer @GeraldGEmerick , It is not clear to me. Could you provide an example?

@EstherBR Here is an example that more or less aligns with what you are trying to do:

 

Create a table called "Categories":

CategorySort
Total Segment1
Dallas2
New York3
San Francisco4

 

Set the Sort column to be the Sort by column for Category.

 

Now create the following measure for use in your Matrix:

My Measure =
VAR _Category = MAX( 'Categories'[Category] )
VAR _Return =
  IF(
    _Category = "Total Segment",
    SUM( 'Cities'[Sales] )
    CALCULATE( SUM( 'Cities'[Sales] ), FILTER( 'Fact Table', [City] = _Category ) )
  )
RETURN _Return

 

Put the Category column from your Categories table as the rows to your matrix and My Measure as the Values.

v-sdhruv
Community Support
Community Support

Hi @EstherBR ,

Just wanted to check if you got a chance to review the suggestions provided and whether that helped you resolve your query?

Thank You

v-sdhruv
Community Support
Community Support

Hi @EstherBR ,

Just wanted to check if you got a chance to review the suggestions provided and whether that helped you resolve your query?

Thank You


GeraldGEmerick
Super User
Super User

@EstherBR You will need to use a table for the rows that does not have any relationships to your other tables. You can then construct a single measure that forms the relationship between that table and the rest of your data that you would then use in the matrix as the Value.

Helpful resources

Announcements
Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.