Forum Discussion
formatting and customizing Matrix rows and Column
shahinnakhai , if these are values of columns. Create a sort column and mark it as sort column
https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column
if these are measure or row, change the order
- shahinnakhai6 years agoFrequent Visitor
those values are changing and I am using direct query. I just want to customize in my order
UCS
CSE
Net revenue
Gross Margine
DME
COGS
OPEXNon_op
and if values are changed they stay the same.
thanks
- edhans6 years agoCommunity Champion
You have to use the Sort By Columns feature as amitchandak has linked to. What you will need to do though is enter your data into a table somewhere for sorting. You can use the Enter Data feature of Power BI to do this and create a table like this:
Then you merge this with your main table and expand the Sort Order column.
However, this will not work with Direct Query. So you will have to create this table on your source server (SQL, AzureSQL, whatever) and then merge.
As a last resort, you can try to do this with a conditional column. Power Query is pretty good about semi-complex if/then/else statements and folding them back, but I've never tried one with 7 steps. Below will get you started:
You won't know until you try it to see if it folds properly and allows Direct Query to continue working. You would add this column to your table where those fields exist.
- shahinnakhai6 years agoFrequent VisitorSuper User II
I have created the new column in my SQL table based on what I want to be sort by, but still doesn't give me an option based on that.