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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Anonymous
Not applicable

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!

Anonymous
Not applicable

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors