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

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.

Reply
Thiagops
Helper II
Helper II

Classificar Por Coluna

Boa noite,

Preciso fazer uma CLASSIFICAÇÃO POR COLUNA na coluna CP_FUNC_INS_DTHR (2)

Thiagops_0-1714001562488.png

 

Para isso criei uma coluna índice, la no power query, porem aparece o seguinte erro:

Thiagops_1-1714001750277.png

 

Verifiquei e na coluna INDICE que o power query gerou automaticamente não possui itens repetidos, mas mesmo assim o erro continua. Alguma consegue me ajudar?

 

Em resumo, a coluna CP_FUNC_INS_DTHR (2) se refere a data de inclusão do pedido e preciso que ela fique em ordem crescente na segmentação de dados em que foi inserido. Atualmente esta desconfigurada (Esta deixa em ordem de dia, mas não esta respeitando o mês), conforme imagem abaixo:

Thiagops_2-1714002551033.png

Grato

 

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

Hi @Thiagops ,

 

This is the raw data I created for testing.

Date

Sales

2023/2/10

100

2023/2/8

250

2023/2/6

150

2023/2/2

200

 

Make sure that the 'CP_FUNC_INS_DTHR (2)' column is in the correct date format.

 

In Power Query, you can use the 'Transform' > 'Data Type' > 'Date' function to ensure that the column is being treated as a date.

 

Also in Power Query, you can try sorting the column directly before loading the data into the model.

 

Select the column 'CP_FUNC_INS_DTHR (2) ', and choose 'Sort Ascending'.

vhuijieymsft_0-1714010389819.png

 

Create a index column in Power Query:

vhuijieymsft_1-1714010389820.png

vhuijieymsft_2-1714010415223.png

 

After loading the data into the template, you can define the sorting of the 'CP_FUNC_INS_DTHR (2) ' column using the 'Sort by Column' functionality.

 

Select the 'CP_FUNC_INS_DTHR (2) ' column in the fields panel, go to the 'Column Tools' tab and choose 'Sort by Column', selecting the index column you created.

vhuijieymsft_3-1714010415232.png

 

The pbix file is attached.

 

For more details, please see the documentation:

Sort one column by another column in Power BI - Power BI | Microsoft Learn

 

If you can't solve it, can you provide me with the pbix link? Please do not log in to your account in Power BI Desktop when uploading pbix files.

 

I hope this information helps to solve the problem. I'm happy to answer any further questions you may have.

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

View solution in original post

1 REPLY 1
v-huijiey-msft
Community Support
Community Support

Hi @Thiagops ,

 

This is the raw data I created for testing.

Date

Sales

2023/2/10

100

2023/2/8

250

2023/2/6

150

2023/2/2

200

 

Make sure that the 'CP_FUNC_INS_DTHR (2)' column is in the correct date format.

 

In Power Query, you can use the 'Transform' > 'Data Type' > 'Date' function to ensure that the column is being treated as a date.

 

Also in Power Query, you can try sorting the column directly before loading the data into the model.

 

Select the column 'CP_FUNC_INS_DTHR (2) ', and choose 'Sort Ascending'.

vhuijieymsft_0-1714010389819.png

 

Create a index column in Power Query:

vhuijieymsft_1-1714010389820.png

vhuijieymsft_2-1714010415223.png

 

After loading the data into the template, you can define the sorting of the 'CP_FUNC_INS_DTHR (2) ' column using the 'Sort by Column' functionality.

 

Select the 'CP_FUNC_INS_DTHR (2) ' column in the fields panel, go to the 'Column Tools' tab and choose 'Sort by Column', selecting the index column you created.

vhuijieymsft_3-1714010415232.png

 

The pbix file is attached.

 

For more details, please see the documentation:

Sort one column by another column in Power BI - Power BI | Microsoft Learn

 

If you can't solve it, can you provide me with the pbix link? Please do not log in to your account in Power BI Desktop when uploading pbix files.

 

I hope this information helps to solve the problem. I'm happy to answer any further questions you may have.

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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