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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Huicho_2024
Frequent Visitor

Ordenar grafico por categoria o serie

Buenas tardes,

 

Tengo un grafico que necesita ser ordenado ya sea por serie o por categoria, depende de que quiera el usuario. Se que manualmente no se puede, por lo que mi pregunta si lo puedo hacer por DAX y cómo sería, Son mis primeros pasos en DAX.

 

De antemano muchas gracias!

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

Hi @Huicho_2024,

 

We can use the following measures to create custom orders in your need as shown below:

 

OrderByCategory = SWITCH(SELECTEDVALUE('Table'[category]),"A",1,"B",2,"C",3)

 

OrderBySeries = SWITCH(SELECTEDVALUE('Table'[series ]),"ser1",1,"ser2",2)

 

Then users could choose different measures to sort by, as shown below:

vyajiewanmsft_0-1724982352808.png

Best regards,

Joyce

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

2 REPLIES 2
Huicho_2024
Frequent Visitor

Thks, It works!

v-yajiewan-msft
Community Support
Community Support

Hi @Huicho_2024,

 

We can use the following measures to create custom orders in your need as shown below:

 

OrderByCategory = SWITCH(SELECTEDVALUE('Table'[category]),"A",1,"B",2,"C",3)

 

OrderBySeries = SWITCH(SELECTEDVALUE('Table'[series ]),"ser1",1,"ser2",2)

 

Then users could choose different measures to sort by, as shown below:

vyajiewanmsft_0-1724982352808.png

Best regards,

Joyce

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Solution Authors
Top Kudoed Authors