Forum Discussion

Black3y's avatar
Black3y
Microsoft Employee
5 years ago
Solved

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"
 
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!
 
 
  • @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?

6 Replies