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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
newpbiuser01
Helper V
Helper V

Using a Measure as a Row Header

Hello,

 

I have a table that shows the Sales by the Employee, Country and City. I need to show a matrix visual as a report that breaks down the Sales by Employee and all the cities they had sales in which is filterable by country. 

 

So, for the following table: 

CountryEmployeeCitySales
CanadaAToronto79
USBBoston31
AustraliaCBrisbane15
USDNew York48
AustraliaASydney17
CanadaBVancouver12
AustraliaCMelbourne94
CanadaDMontreal79
USABurlington22
AustraliaACanberra14
CanadaBHalifax67
AustraliaCMelbourne49
CanadaDCalgary36
USASeattle71
CanadaDRegina98
AustraliaASydney83
CanadaDToronto93
USABoston84

 

So the report/matrix visual when filtered for US would give the following result:

EmployeeCitiesSales
ABoston, Burlington, Seattle177
BBoston31
DNew York478

 

Similarly, filtering for Canada would give:

EmployeeCitiesSales
AToronto79
BHalifax, Vancouver79
DCalgary, Montreal, Regina, Toronto306

 

For the matrix visual in Power BI, I used a measure to concatenate the cities, however, I still cannot use the concatenated cities as a row header/row option because Power BI won't let me use a measure as a row header. How can I do that? I know there's an option to use the value as a header but that doesn't allow me to only show the one value (Concatenated Cities) as a row header and the rest of them as values. How do I select a specific measure to show show as a row header and leave the other "values" (Sales, Quantity etc. as "values")? I want to see the breakdown by the employee and cities. 

 

I"d appreciate any help!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @newpbiuser01 ,

Based on my testing, please try the following methods as workaround:

1.Create the sample table.

vjiewumsft_0-1721698117454.png

2.Create the new measure to calculate the sales, quantity and cities.

Sum of Sales = if(ISINSCOPE('Table'[Team])&&ISINSCOPE('Table'[Employee]),SUM('Table'[Sales]))
Sum of Quantity = if(ISINSCOPE('Table'[Team])&&ISINSCOPE('Table'[Employee]),SUM('Table'[Quantity]))
Cities = if(ISINSCOPE('Table'[Employee])&&ISINSCOPE('Table'[Team]),BLANK(),CONCATENATEX(VALUES('Table'[City]), 'Table'[City], ", "))

3.Drag the measures into the matrix values.

vjiewumsft_1-1721698132495.png

4.Set the warp in the format settings.

vjiewumsft_2-1721698140287.png

5.Drag the left border to override the measure.

vjiewumsft_3-1721698172226.png

vjiewumsft_4-1721698176650.png

6.The result is shown below.

vjiewumsft_5-1721698186437.png

Besides, you can also raise a new idea and add the comments there to make the feature coming sooner.

Home (microsoft.com)

 

Best Regards,

Wisdom Wu

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

3 REPLIES 3
Anonymous
Not applicable

Hi @newpbiuser01 ,

Based on my testing, please try the following methods as workaround:

1.Create the sample table.

vjiewumsft_0-1721698117454.png

2.Create the new measure to calculate the sales, quantity and cities.

Sum of Sales = if(ISINSCOPE('Table'[Team])&&ISINSCOPE('Table'[Employee]),SUM('Table'[Sales]))
Sum of Quantity = if(ISINSCOPE('Table'[Team])&&ISINSCOPE('Table'[Employee]),SUM('Table'[Quantity]))
Cities = if(ISINSCOPE('Table'[Employee])&&ISINSCOPE('Table'[Team]),BLANK(),CONCATENATEX(VALUES('Table'[City]), 'Table'[City], ", "))

3.Drag the measures into the matrix values.

vjiewumsft_1-1721698132495.png

4.Set the warp in the format settings.

vjiewumsft_2-1721698140287.png

5.Drag the left border to override the measure.

vjiewumsft_3-1721698172226.png

vjiewumsft_4-1721698176650.png

6.The result is shown below.

vjiewumsft_5-1721698186437.png

Besides, you can also raise a new idea and add the comments there to make the feature coming sooner.

Home (microsoft.com)

 

Best Regards,

Wisdom Wu

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

newpbiuser01
Helper V
Helper V

Hello,

 

I am unable to upload a file unfortunately, but here is my data. 

CountryEmployeeCitySalesQuantityTeam

CanadaAToronto7910Team A
USBBoston3150Team B
AustraliaCBrisbane151Team A
USDNew York483Team C
AustraliaASydney1745Team A
CanadaBVancouver1254Team B
AustraliaCMelbourne9421Team C
CanadaDMontreal7989Team B
USABurlington2234Team A
AustraliaACanberra141Team C
CanadaBHalifax6732Team B
AustraliaCMelbourne4911Team B
CanadaDCalgary3620Team C
USASeattle7131Team A
CanadaDRegina9854Team B
AustraliaASydney8364Team C
CanadaDToronto9378Team A
USABoston8438Team C

I only have one table, and one measure: 

Cities: 

Cities = CONCATENATEX(VALUES('Table'[City]), 'Table'[City], ", ")
 
I am trying to break the spend and quantity by Employee and show a concatenated list of their cities. However, as I mentioned, I am unable to use a measure as a row header. So what I get is: 

newpbiuser01_1-1720461254850.png

 

What I need is: 

newpbiuser01_2-1720461274381.png

 

 

foodd
Super User
Super User

Hello @newpbiuser01 , and thank you for sharing a question with the Community.   This reply is informational.   Please  remember to adhere to the decorum of the Community Forum when asking a question.

Please provide your work-in-progress Power BI Desktop file (with sensitive information removed) that covers your issue or question completely in a usable format (not as a screenshot). You can upload the PBIX file to a cloud storage service such as OneDrive, Google Drive, Dropbox, or to a Github repository, and then share a file’s URL.

https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

This allows members of the Forum to assess the state of the model, report layer, relationships, and any DAX applied.

 

If your requirement is solved, please make THIS ANSWER a SOLUTION ✔️ and help other users find the solution quickly. Please hit the LIKE 👍 button if this comment helps you.  Proud to be a Super User!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.