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
amdi_silword
Frequent Visitor

How to get NAMEOF to return an Amount in a Matrix

I have this code which create a new Table.

FP - X-axis = {
    ("Avg. Selling Price", NAMEOF('Sales'[Avg. Selling Price]), 0),
    ("Margin %", NAMEOF('Sales'[Margin %]), 1),
    ("Sales YoY", NAMEOF('Sales'[Sales YoY]), 2),
    ("Sales PY", NAMEOF('Sales'[Sales PY]), 3),
    ("Sales", NAMEOF('Sales'[Sales Amount]), 4)
}
If I place ex. Continent in a Matrix and The name of the table FP - X-axis in the value then will all the row names be placed in the Matrix and the amount for each row.
But I can't reproduce it by copy the code and create a New Table, so it works in a Matrix in my own dataset.
In the data section in the right section of the screen there is a little icon which I don't know how to get. I think that the resason it works but I can not recreate so it works.
Icon.png
And a picture from the table:
 FP - X-axis.png
The Matrix look like this where the name of the first column is placed in Value in the Matrix
Matrix.png
Does anyone know how it might work.?
 
 
1 ACCEPTED SOLUTION
vicky_
Super User
Super User

The code snippet you posted is from the Fields Paramter feature - https://www.sqlbi.com/articles/fields-parameters-in-power-bi/. I suggest using the button to create those tables and then editing the table code yourself.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @amdi_silword ,

 

Did @vicky_  reply solve your problem? If so, please mark it as the correct solution, and point out if the problem persists.

 

Best Regards,
Adamk Kong

vicky_
Super User
Super User

The code snippet you posted is from the Fields Paramter feature - https://www.sqlbi.com/articles/fields-parameters-in-power-bi/. I suggest using the button to create those tables and then editing the table code yourself.

vicky, Thanks for your help

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.

Top Solution Authors
Top Kudoed Authors