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
Black3y
Microsoft Employee
Microsoft Employee

Measure as Column in Matrix

Hi all,

 

I can see from various other threads that there is no simple way to use a Measure as a column in a matrix.  I have looked at the "Disconnected table trick" post but I am struggling to make this work for my particular scenario and I am wondering if this is down to my lack of PowerBI skills or becuase I am working in DirectQuery mode (which of course prohibits the creation of a new column... that would make it too easy of course 🙂 )

 

So, I have a calculated measure called "Project Name" as below, that runs through all of the contents of "Subscription.Name" and maps to a value that makes more sense to our users, called Project Name

 

Project Name = If(CONTAINS('Subscriptions','Subscription'[Subscription Name],"XXXXX"),"New Project Name"
 
This allows me to use the the resulting measure in a table, but I am unable to add to a Matrix such as the example below, where ideally i would replace "Subscription Name" with the measure, and show "Project Name"
 
MoM.png
Is there another way for me to relate subscription name to a new field? Is there another way for me to get the result above with Project Name replacing Subscription Name?
 
Many thanks in advance!
 
 
1 ACCEPTED SOLUTION
AllisonKennedy
Super User
Super User

@Black3y
Is a composite model a possibility for this report? https://docs.microsoft.com/en-us/power-bi/transform-model/desktop-composite-models
If so, you could create an allocation table to do this.
Otherwise, you can't measure columns in Power BI. You could put it in Values, but for it to work for the screenshot you've posted, you'd have to create a separate measure for each MoM$ Month (for example, July Mem $, August MoM $, etc.) otherwise you'll end up with the repeated project name for each month.
I guess another option would be to turn off automatic resizing of column widths and make additional project columns result from hidden values as suggested by @Greg_Deckler

Does any of that make sense?

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User

@Black3y , Not very clear, but seems like a case of bucketing.

If so you need have measured and then join that measure with and independent table to use that independent tables and you have do it for all measures.

 

You can refer this example

https://www.daxpatterns.com/dynamic-segmentation/
https://www.daxpatterns.com/static-segmentation/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

thanks @amitchandak - those links look good but I am not sure I am not sure I know how to use it in this example... I will take a look though.

AllisonKennedy
Super User
Super User

@Black3y
Is a composite model a possibility for this report? https://docs.microsoft.com/en-us/power-bi/transform-model/desktop-composite-models
If so, you could create an allocation table to do this.
Otherwise, you can't measure columns in Power BI. You could put it in Values, but for it to work for the screenshot you've posted, you'd have to create a separate measure for each MoM$ Month (for example, July Mem $, August MoM $, etc.) otherwise you'll end up with the repeated project name for each month.
I guess another option would be to turn off automatic resizing of column widths and make additional project columns result from hidden values as suggested by @Greg_Deckler

Does any of that make sense?

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Greg_Deckler
Community Champion
Community Champion

@Black3y Sorry, having trouble following, can you post sample data as text and expected output?

 

I can't even tell from your image what is a subscription name or project name because everything is blanked out. Maybe you could include subscription name and project name in the matrix and just shrink the subscription name column/row down to nothing?

 

Or maybe custom matrix hierarchy? https://community.powerbi.com/t5/Quick-Measures-Gallery/The-New-Hotness-Custom-Matrix-Hierarchy/m-p/...


Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

I will try again...

 

I use the folliing query to create a new meansure called Project Name as "subscription name" means very little to my users.

 

Project Name = If(CONTAINS('Subscriptions','Subscription'[Subscription Name],"XXXXX"),"New Project Name"

 

They can then use the report and look at their "Projects".

 

Desired result below... simply replacing the content of "Subscriptions" field with the contents of "Project Name"

 

MoM2.png

@Black3y Yeah, I don't see that happening without it being a composite model per @AllisonKennedy 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

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