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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Jozef_KaBa
New Member

sort visual by 2 variables

Hi community,

I am preparing the custom visual (vertical line chart) via DENEB in PBI and I would like to set up the sorting values base on two different variables. I tried to find out on different web sites, without success. Is it possible? Could you advice me any solution? thanks Jozef

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @Jozef_KaBa ,

 

Are both variables numbers? If so, you can refer to the following program:

vtianyichmsft_0-1712122687026.png

Total = 0.4*[Value1]+0.6*[Value2]

Rank = var _t = ADDCOLUMNS('Table',"Rank",RANKX(ALL('Table'),[Total],,DESC,Dense))
RETURN MAXX(_t,[Rank])

 

An attachment for your reference. Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

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

Dear Scott, many thanks for your explantion.

I am going to implement the code and check. 

Regards,

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Jozef_KaBa ,

 

Are both variables numbers? If so, you can refer to the following program:

vtianyichmsft_0-1712122687026.png

Total = 0.4*[Value1]+0.6*[Value2]

Rank = var _t = ADDCOLUMNS('Table',"Rank",RANKX(ALL('Table'),[Total],,DESC,Dense))
RETURN MAXX(_t,[Rank])

 

An attachment for your reference. Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

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

Dear Scott, many thanks for your explantion.

I am going to implement the code and check. 

Regards,

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.