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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
jasemilly
Helper I
Helper I

Basic table using Deneb

Happy new year to everyone!!

I am following How to Fix Measure totals with Deneb , by Gregg from Enterprise DNA. I have followed this tutorial the orignal blog that the video is based on vega-lite-table-using-text-marks  and another solution I found via stackover flow.

I run into the same issue with all 3 versions.  I have one row data that has all the values for each column sat on top of each other.

Value all on top of each otherValue all on top of each other

I am passing 3 fields Year & Month are both dimensions and Revenue is a measure.

here is my code.

thanks for all help

 

 

 

{
  "height": {"Step": 50},
  "data": {"name": "dataset"},
  "layer": [
    {
      "transform": [
        {
          "window": [
            {
              "op": "row_number",
              "as": "row_num"
            }
          ]
        },
        {
          "calculate": "format(datum.Revenue,'.1f')",
          "as": "Revenue"
        },
        {
          "fold": [
            "Revenue",
            "FiscalYear",
            "Month"
           
            
          ]
        }
      ],
      "mark": "text",
      "encoding": {
        "y": {
          "field": "row_num",
          "type": "ordinal",
          "axis": {
            "grid": true,
            "tickBand": "extent",
            "title": false,
            "labels": false
          }
        },
        "text": {
          "field": "value",
          "type": "nominal"
        },
        "x": {
          "field": "key",
          "type": "nominal",
          "axis": {
            "orient": "top",
            "labelAngle": 0,
            "title": null,
            "domain": true,
            "ticks": false,
            "grid": false,
            "tickBand": "extent"
          },
          "scale": {"padding": 15}
        }
      },
      "config": {
        "view": {"stroke": null}
      }
    },
    {
      "transform": [
        {
          "window": [
            {
              "op": "row_number",
              "as": "row_num"
            }
          ]
        },
        {
          "fold": [
            "Revenue",
            "FiscalYear",
            "Month"
          ]
        },
        {
          "filter": "isFinite(datum.Value)"
        }
      ],
      "mark": {
        "type": "text",
        "color": "firebrick",
        "align": "center",
        "y": -25
      },
      "encoding": {
        "x": {
          "field": "key",
          "axis": {"orient": "top"}
        },
        "text": {
          "aggregate": "sum",
          "field": "value",
          "impute": {"value": null},
          "format": ",.2f"
        }
      }
    }
  ]
}

 

 

 

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@jasemilly I'm not sure this is the problem but you have "Step" instead of "step" in your "height" property at the top. I attached the JSON template below. It is also available on MicrosoftHatesGreg github repository. Also the original PBIX file. 

 


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
jasemilly
Helper I
Helper I

Thank you, I copied the visual for each of my different tests, I went over every line so many times apart from the first one!  Don't know weather to laugh or cry ! thanks again.

@jasemilly Trust me, I've been there! Sometimes it just takes another pair of eyes!


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Super User
Super User

@jasemilly I'm not sure this is the problem but you have "Step" instead of "step" in your "height" property at the top. I attached the JSON template below. It is also available on MicrosoftHatesGreg github repository. Also the original PBIX file. 

 


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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