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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
ktt777
Helper V
Helper V

Changing the column sequences in matrix

Hi 

i have a matrix as below .  How can i arrange the column sequences to  : Base -> Target->Q1-2021->Q2-2021? 

And No column order from 1 to 3 ascending 

ktt777_0-1627893027702.png

Here is the link to power bi file : https://1drv.ms/u/s!ApIDnMK2eKiFgR4xe4rl5XS7WvWl?e=hNb0rb

 

thank you. 

1 ACCEPTED SOLUTION

Hi, @ktt777 

 

Try to create a measure like this:

_color = 
var _r=CALCULATE([measure],FILTER('Test 2','Test 2'[Period]="Target"))
var _ifIsQ1Q2=
    IF(MAX('Test 2'[Period]) in {"Q1-2021","Q2-2021"},
    IF([measure]>_r,"red","green")
    )
return _ifIsQ1Q2

Result:

vangzhengmsft_0-1628573478317.png

Please refer to the attachment below for details

 

 

Hope this helps.

 

Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
ktt777
Helper V
Helper V

How can  i format the value in Q1-2021 and Q2-2021 such as being highlighted in green if it is less than target and red if it is more than target?

 

thanks 

Hi, @ktt777 

 

Try to create a measure like this:

_color = 
var _r=CALCULATE([measure],FILTER('Test 2','Test 2'[Period]="Target"))
var _ifIsQ1Q2=
    IF(MAX('Test 2'[Period]) in {"Q1-2021","Q2-2021"},
    IF([measure]>_r,"red","green")
    )
return _ifIsQ1Q2

Result:

vangzhengmsft_0-1628573478317.png

Please refer to the attachment below for details

 

 

Hope this helps.

 

Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-angzheng-msft
Community Support
Community Support

Hi, @ktt777 

 

The sample file provided by @ryan_mayu  has already achieved the purpose very well.
Please let me describe the implementation process. You need to create a sorting column for the rows and columns in the matrix separately, and the sorting column and the row and column fields are in the same table.

In your sample I saw that you created a summary field to sort. This is a good idea, but because the summary field comes from your row field, then circular dependencies will occur here, which cannot be sorted by column.

You can manually create two sorted tables and use the RELATED function to create sorted fields in the same table.

vangzhengmsft_1-1628045049536.pngvangzhengmsft_2-1628045058226.png

Please refer to the attachment below for details

 

 

Hope this helps.

 

Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

ryan_mayu
Super User
Super User

@ktt777 

pls see the attachment below

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




amitchandak
Super User
Super User

@ktt777 , if these are measures in values, You can move up and down. If these are column values you need a sort column and the mark that a sort column

 

How to Create Sort Column and Solve Related Errors: https://youtu.be/KK1zu4MBb-c

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.