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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
CJKPowerBI
Helper I
Helper I

Change of column sorting

Hello all,

 

i have the below measure

 

Total per column per year: = sumx(ADDCOLUMNS(SUMMARIZE('Family situation PowerBI','Family situation PowerBI'[Type],'Family situation PowerBI'[Date].[Year]),"@result",[ValueLatestDate(all Years)]),[@result])

 

which gives me the below results

 

Screenshot 2022-10-31 140430.png

 

 

and i would like to know if i can have the columns Balance and Invested different with Invested to be first and second to be Balance.

 

than you

 

 

1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
Community Support

Hi @CJKPowerBI ,

 

Please try:

vjianbolimsft_1-1667371394432.png

vjianbolimsft_2-1667371435663.png

Then choose sort by column:

vjianbolimsft_3-1667371488872.png

Final output:

vjianbolimsft_4-1667371508754.png

Best Regards,

Jianbo Li

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
v-jianboli-msft
Community Support
Community Support

Hi @CJKPowerBI ,

 

Please try:

vjianbolimsft_1-1667371394432.png

vjianbolimsft_2-1667371435663.png

Then choose sort by column:

vjianbolimsft_3-1667371488872.png

Final output:

vjianbolimsft_4-1667371508754.png

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

hello @v-jianboli-msft 

 

i figured out the issue, the issue was that some of my text was:

- Invested

- invested (with not capital I)

 

and that was giving the error...

 

that works great,

thank you

hello @v-jianboli-msft 

 

i tried the above and at the pic which i sort i get the below error

 

Screenshot 2022-11-02 111214.png

v-jianboli-msft
Community Support
Community Support

Hi @CJKPowerBI ,

 

Based on your description, I have created a simple sample:

vjianbolimsft_0-1667282316311.png

vjianbolimsft_1-1667282328626.png

Please try:

Create a sort column:

vjianbolimsft_2-1667282369119.png

here is the M code:

= Table.AddColumn(#"Removed Columns", "Sort Column", each if [1] = "Balance" then 2 else 1)

Then sort by column:

vjianbolimsft_3-1667282446495.png

Final output:

vjianbolimsft_4-1667282461902.png

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello @v-jianboli-msft 

 

i tried to follow your instructions and even look at the .pbix file but unsuccesfully couldnt make it work.

 

below is part of my data

 

Screenshot 2022-11-01 095718.png

 

and if i understood i need to make a column with the formula which you gave me that all no?

 

can you look at your formula based on my columns above?

 

thank you

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 Kudoed Authors