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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Henry_Yang83
Frequent Visitor

How to add measure to row of Matrix

Hello Everyone,  I used a matrix to express a hierarchy data.

row area1 of matrixrow area2 of matrixrow area3 of matrixrow area4 of matrixValue area
CompanyNamestock pricestock amounttrade typeavg price

companyA

2.451000type11.76

 

  type22

 

  type32.5
companyB13.442000type112.55
   typ212.1
   type314.1

 

as we can see, top 4 columns belong company level, so they can be set into a row of matrix setting.

 when I added the avg price to Value area of matrix, it will be separated by different rows.

 

Now I bulid a measure, which is be calucated by company level,  but Matrix control could not support add this meaure to row area of matrix, so How do I add this kind of value into this matrix before [Trade type] column.

 

Thanks in advanced.

1 ACCEPTED SOLUTION

First, trade type has to move to the right of Company Name so what you want while possible can be finnicky. Second the solution is very similar to the links in my previous reply. Thrid, we don't have a sample data to work with. What you have posted is your expected output. https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447... 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

13 REPLIES 13
danextian
Super User
Super User

Hi @Henry_Yang83 

 

I answered similar posts yesterday.

https://community.fabric.microsoft.com/t5/Desktop/Matrix-Visual/m-p/4321736#M1353457

https://community.fabric.microsoft.com/t5/Desktop/Add-Measure-as-a-Column-Subtotal-in-a-Matrix/m-p/4...

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Thanks Danextian your advice, but I just want to get this kind of result. @danextian 

CompanyNamestock pricestock amountMeasuretrade typeavg price

companyA

2.45100020.16type11.76
    type22
    type32.5
companyB13.44200045type112.55
    typ212.1
    type314.1
      
      

There is another measuer to calucte by company level. and it will be added in matrix before Trade type.

So  any suggestion for it.

Thanks

Hi @Henry_Yang83 ,
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet.
In case if you have any resolution please do share that same with the community as it can be helpful to others.
Otherwise, will respond back with the more details and we will try to help.

Hi @Henry_Yang83 

we haven't heard back from you regarding our last response and wanted to check if your issue has been resolved.

If our response addressed your query, please mark it as Accept Answer and click Yes if you found it helpful.

Should you have any further questions, feel free to reach out.
Thank you for being a part of the Microsoft Fabric Community Forum!

Hi @Henry_Yang83 ,

Since we haven’t heard back from you for a while, we are planning to close this ticket. If you have any further questions or need assistance in the future, please don’t hesitate to reach out by opening a new ticket in the Fabric Community.

Thank you for being an active part of our community we’re always here to help!

First, trade type has to move to the right of Company Name so what you want while possible can be finnicky. Second the solution is very similar to the links in my previous reply. Thrid, we don't have a sample data to work with. What you have posted is your expected output. https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447... 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Ritaf1983
Super User
Super User

Hi @Henry_Yang83 ,

It’s a bit hard to understand exactly what you’re trying to calculate without seeing the data itself, as you only provided a schematic of the final matrix. That said, if the goal is to control how a measure is displayed across hierarchy levels, you can use the ISINSCOPE function.

ISINSCOPE lets you check the current hierarchy level and decide what logic to apply. For example, you can show a specific value at one level (like CompanyName) and return a blank at other levels (like Trade Type).

Here’s an example:

If you want the Avg Price measure to appear only at the CompanyName level and leave the Trade Type level blank, you could write:

DAX
Copy code
Avg Price Display =
IF(
ISINSCOPE('YourTable'[Trade Type]),
BLANK(),
[Avg Price] -- Replace with your actual Avg Price measure
)
How it works:
ISINSCOPE('YourTable'[Trade Type]): Checks if the current level is Trade Type.
BLANK(): Returns blank when you’re at the Trade Type level, so no value is shown there.
[Avg Price]: Displays the average price at the CompanyName level (or wherever Trade Type is not in scope).

more information about the logic in the linked video :
https://www.youtube.com/watch?v=DtOfcsS_pQw&t=2s

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Thanks Ritaf, I just want to build a measure to calculate something by company level, it works, but this measure could not be added into row of matrix, so I have to find another way to instead of this measure way and show the value before the [trade type] column.

Hi again
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

no problem @Ritaf1983  let me describe it more detail.

Table 1 like below 

CompanyNamestock pricestock amounttrade typeavg price

companyA

2.451000type11.76

 companyA

 2.45 1000type22

companyA

 2.45 1000type32.5
companyB13.442000type112.55
 companyB 13.44 2000typ212.1
 companyB 13.44 2000type314.1

 

this part of data build a matrix, like I mentioned.

 

Table 2

Companycostdate
companyA

45,000

2024-5-16
companyA32,0002024-3-8

 

New measure comes from Table 2

cost_Period =
CALCULATE (
    SUM ( 'Table2'[cost] ) / 100000000,
    FILTER (
        'Table2',
        'Table2'[date] >= [Selected start Date] &&
        'Table2'[date] <= [Selected End Date]
    ),
    NOT ISBLANK('Table2'[cost])
)
[Selected start Date] & [Selected End Date] comes from 2 slicer.
finally, I want to add [cost_Period] into matrix result ,which column should before [Trade type] in the result matrix.
 
how do I deal with it.

 

Hi @Henry_Yang83 ,

Thanks for reaching out to the Microsoft Fabric Community forum.

 @Ritaf1983 @danextian  Thank you for the prompt response, please allow me to provide another insight: 

Set Up Slicers: Add slicers for [Selected start Date] and [Selected End Date] to filter the measure dynamically.

Create a Measure for Cost_Period =

Cost_Period =

CALCULATE(
    SUM('Table 2'[Cost]) / 100000,
   
        NOT(ISBLANK('Table 2'[Cost]))
    )
  • Add to the Matrix:
    • Add Cost_Period to the Values of the matrix.
    • Drag it to appear before Trade Type.
  • Verify Relationships: Ensure Table 1 and Table 2 are related via CompanyName for proper aggregation.
  • We tried this on our end, and it’s working fine. Kindly refer to the screenshot below for reference:
    AbdulAtheeque_0-1733999088158.png


    Did I answer your question? Then please mark my post as the solution.
    If I helped you, click on the Thumbs Up to give Kudos.



Thanks @v-aatheeque  for your suggestion.

I need shows all trade type and related value rather than first one of them.

Henry_Yang83_0-1734068447010.png

So I have to drag the trade type to row of matrix, and other value column in value of matrix.

this new measure currently just show the value of matrix, cause it is a kind of value.

but it is company level data, so it could not be under tradetype. so my quesiton is how to show it.

 

Thanks again

 

 

Hi @Henry_Yang83 ,


Could you please share the screenshots and the measures you have used for better assistance?

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.