Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
thentangler
Frequent Visitor

Assigning order to Attribute column

I have 4 columns: Measurement, Quarter, Attribute and Value. The Value column is not shown in the screenshot. 

This is an unpivoted table from a flat table so that I can utilize a matrix visualization where the columns would be the Quarter and the rows would be the attributes. Each matrix vis would be filtered by the measurement column. So one vis would show values for HEIGHT and another only for WEIGHT.

I want to arrange the rows in the matrix visual such that the Mean is shown first, then Median, Min, Max and so on. However it is displaying by alphabetical order. 

I tried creating an Order column using conditional column such that I assign 1 if the attribute column value = "Mean" and so on, but I get the error saying that " There cant be more than value in 'Order' for the same value in 'Attribute'

I checked and each attribure value has a distinct number, albeit multiple occurences of the same number across the various measurements.

 

thentangler_0-1714416685074.png

Is there any way I can achieve what I want?

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@thentangler You can create a conditional column in Power Query (nested if then else statements) or you could create a DAX calculated column using a SWITCH statement to assign a number. I think if you want to use the column as a Sort By column that you want to use PQ to avoid potential circular references.



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...

How do I create nested If statements using the GUI in Power Query? 
Would I assign the number 1 for the Attribute 'Mean' when Measurement = HEIGHT and Quarter =1. And would I assign 2 if Quarter = 2? That would create a large sorting order? Cant Power BI use the order grouped by Measurement and Quarter?

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors