We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hello,
I'm trying to sort my matrix table (link to Power BI File) by a specific column, in my case Leads for ContactGroup "A".
In the past is was possible to simply add a measure as a tooltip and use it for sorting, but that doesn't work anymore.
This is my table.
It should look like this, but without the SumLeads A Column. 😄
I was wondering if somehow it's possible to do with visual calculations... but I couldn't find a possible solution and am at a loss now.
Any input is much appreciated. 🙏
Solved! Go to Solution.
Create a measure that calculates Leads for ContactGroup A:
Sort Leads A =
CALCULATE(
[Leads],
'ContactGroup'[ContactGroup] = "A"
)
Add this measure to the matrix:
Put it in Values
Turn off visibility:
Set column width very small, or
Rename to blank, or
Hide via conditional formatting (font = background)
Then: Matrix → More options (…) → Sort by → Sort Leads A
Hi @cn4422
Sorting by different columns is only possible when those columns aren’t coming from a dimension. Once a measure is broken down by a dimension (like categories), individual sorting per category isn’t supported. The visual will sort using the total column, which means the total must reflect the value of the specific category rather than the aggregate of all categories. Also, adding a measure as a tooltip has generally not been supported for matrix and table visuals (it works only with some other visuals).
Sample measure to return the value of A at the total column.
new measure =
IF (
NOT ( HASONEVALUE ( 'table'[ContactGroup] ) ),
CALCULATE ( [leads measure], KEEPFILTERS ( 'table'[ContactGroup] ) = "A" ),
[leads measure]
)
Of course, this means that the total shows the value of A only.
Create a measure that calculates Leads for ContactGroup A:
Sort Leads A =
CALCULATE(
[Leads],
'ContactGroup'[ContactGroup] = "A"
)
Add this measure to the matrix:
Put it in Values
Turn off visibility:
Set column width very small, or
Rename to blank, or
Hide via conditional formatting (font = background)
Then: Matrix → More options (…) → Sort by → Sort Leads A
@cengizhanarslan @ Thanks for your replay. I actually thought about that too, but I was wondering if there is a "cleaner solution" as well
But if nothing else comes up I will either do that or make separate measures for every columen cause then I can sort individually by everything.
Edit:
I think I'll go with this. In addition, I formatted my measure with ";;;" so that the one column with values makes the values "invisible" as well.
Hi @cn4422 ,
a quick solution would be to add "SumLeads A" as Value, switch off "text wrap" for values and column, reduce the column width of all "SumLeads A" columns to zero and adjust the sort by setting of the matrix visual. Only the little triangle couldn't be removed:
Does that help you?
@Hans-Georg_Puls Thanks for your replay. I actually thought about that too, but I was wondering if there is a "cleaner solution" as well.
But if nothing else comes up I will either do that or make separate measures for every columen cause then I can sort individually by everything.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 57 | |
| 38 | |
| 32 | |
| 18 | |
| 16 |
| User | Count |
|---|---|
| 66 | |
| 66 | |
| 39 | |
| 34 | |
| 25 |