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
Ricardo1
New Member

Ordenar meses gráficos power bi

Holas amigos

muchas gracias por ayudarme en el porcentaje de crecimiento excelente, he elaborado un grafico pero los meses estan desordenados, como ordenarlos he utilizado sort ascendent y tambien sort by column pero sin resultado.

solo tengo una tabla con estas tres columnas, como les puedo enviar el archivo tienen un email?.

muchas gracias

 

AñoMesesventas
2017enero$ 3.9M
2017febrero$ 3.8M
2017marzo$ 4.4M
2017abril$ 5.1M
2017mayo$ 5.0M
2017junio$ 4.4M
2017julio$ 4.9M
2017agosto$ 4.8M
2017septiembre$ 4.4M
2017octubre$ 5.2M
2017noviembre$ 6.0M
2017diciembre$ 4.6M
2 ACCEPTED SOLUTIONS
MFelix
Super User
Super User

Hi @Ricardo1,

 

You need to add a column with the month number and then sort the column Meses by that new column. You should follow this steps:

 

  • Create the month number column (see below the DAX and M Language code)

 

M Language (Query Editor)
if [Meses] = "enero" then 1 else if [Meses] = "febrero" then 2 else if [Meses] = "marzo" then 3 else if [Meses] = "abril" then 4 else if [Meses] = "mayo" then 5 else if [Meses] = "junio" then 6 else if [Meses] = "julio" then 7 else if [Meses] = "agosto" then 8 else if [Meses] = "septiembre" then 9 else if [Meses] = "octubre" then 10 else if [Meses] = "noviembre" then 11 else if [Meses] = "diciembre" then 12 else null

 

 

 

Sort_DAX =
SWITCH (
    Sales[Meses];
    "enero"; 1;
    "febrero"; 2;
    "marzo"; 3;
    "abril"; 4;
    "mayo"; 5;
    "junio"; 6;
    "julio"; 7;
    "agosto"; 8;
    "septiembre"; 9;
    "octubre"; 10;
    "noviembre"; 11;
    "diciembre"; 12;
    BLANK ()
)

 

 

  • Select the column Meses
  • Go to the modeling tab
  • Sort  by column
  • And select the previous column to sort the values

 

Check the documentation attach with full details.

 

Regards

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hello Ricardo1, You could share the answer they gave you with the percentage of growth. Thank you

MFelix
Super User
Super User

Hi @Ricardo1,

 

You need to add a column with the month number and then sort the column Meses by that new column. You should follow this steps:

 

  • Create the month number column (see below the DAX and M Language code)

 

M Language (Query Editor)
if [Meses] = "enero" then 1 else if [Meses] = "febrero" then 2 else if [Meses] = "marzo" then 3 else if [Meses] = "abril" then 4 else if [Meses] = "mayo" then 5 else if [Meses] = "junio" then 6 else if [Meses] = "julio" then 7 else if [Meses] = "agosto" then 8 else if [Meses] = "septiembre" then 9 else if [Meses] = "octubre" then 10 else if [Meses] = "noviembre" then 11 else if [Meses] = "diciembre" then 12 else null

 

 

 

Sort_DAX =
SWITCH (
    Sales[Meses];
    "enero"; 1;
    "febrero"; 2;
    "marzo"; 3;
    "abril"; 4;
    "mayo"; 5;
    "junio"; 6;
    "julio"; 7;
    "agosto"; 8;
    "septiembre"; 9;
    "octubre"; 10;
    "noviembre"; 11;
    "diciembre"; 12;
    BLANK ()
)

 

 

  • Select the column Meses
  • Go to the modeling tab
  • Sort  by column
  • And select the previous column to sort the values

 

Check the documentation attach with full details.

 

Regards

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Muchas gracias!

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.