Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
Can someone please advise how to sort the name by the way I want?
I'm working on PnL report, I want to show asset first in a matrix, then liability, equity, income and expense.
But when I put them in Matrix, it always shows asset, equity, expense, income and liability.
Please adivse, thank you very much.
Solved! Go to Solution.
Hi @hongyuliu ,
If your data is similar with the sample I built below:
Based on my test, using SWITCH() to add a Sort column and then sorting Name column based on it will lead error:
In this case , please follow these steps:
1. Create a new table for sort:
ForSort = ADDCOLUMNS( VALUES(Table2[Name]) , "Index", SWITCH([Name],"asset",1,"liability", 2,"equity",3,"income",4,"expense",5))
2.Select Name column, then sort Name column by Index column:
3. Build relationships between two tables:
Now you could create a Matrix visual as you expected:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
How to sort in ascending
0-50k
50k-100k
100k-150k
150k-200k
Hi @hongyuliu ,
If your data is similar with the sample I built below:
Based on my test, using SWITCH() to add a Sort column and then sorting Name column based on it will lead error:
In this case , please follow these steps:
1. Create a new table for sort:
ForSort = ADDCOLUMNS( VALUES(Table2[Name]) , "Index", SWITCH([Name],"asset",1,"liability", 2,"equity",3,"income",4,"expense",5))
2.Select Name column, then sort Name column by Index column:
3. Build relationships between two tables:
Now you could create a Matrix visual as you expected:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@hongyuliu , You have to create a sort column and mark that a sort column for you column and use that
Name 1 = [Name]
Name Sort = Switch( [Name],
"liability", 1,
"equity",2,
"income",3,
// Add others
100 //default )
Mark Name sort as sort column of name 1 and use name 1 in visual
refer if needed
How to Create Sort Column and Solve Related Errors: https://youtu.be/KK1zu4MBb-c
https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
115 | |
99 | |
86 | |
70 | |
62 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |