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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Deni
New Member

Deneb visual sorting by different measures/columns

Dear all,

I'm new in deneb. I try to do sorting based on user selection from a slicer. In the slicer I have 2 values: By group or By increase

I have 2 tables. 1 for products and 1 for categories. In the categories table I have group column. In the product table I have increase measure.

What I would like to accomplish is conditional sorting in my deneb.

Here it is what I did try but it seems I do not find the right syntax

 "layer": [
{
"mark": {
"type": "text",
"angle": -90,
"baseline": "middle",
"align": "left",
"size": 10,
"color":"grey"
},
"encoding": {
"text": {
"field": "groupdisplay",
"type": "nominal"
},
"x": {
"field": "Category",
"sort": {
"op": "mean",
"condition": {"test": "datum['selectedorder'] = 'By increase'", "value": "Value"},
"value": "groupdisplay"
},
"type": "nominal",
"axis": {
"labelAngle": -45,
"grid": true,
"offset": 10,
"title": null
}
},
"y": {
"field": "Value",
"type": "quantitative",
"axis": {"title": "Value"},
"scale": {"zero": false}
}
}
}]

 

Thank you for your help 🙂

1 REPLY 1
lbendlin
Super User
Super User

You cannot have two tables.  Deneb only recognizes a single dataset based on the items in the Values well.

 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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