Home > Software engineering >  PowerBI - Graphical representation DateTime for room booking
PowerBI - Graphical representation DateTime for room booking

Time:01-21

I have SQL table with datetime information of room booking

room booking table

and I need show graphical representation this data in PowerBI for example as this:

graphical representation of bookings

Is it possible and how? If not what I can use to get similar results?

Thank you for all answers.

CodePudding user response:

You can use Deneb custom visual for this (certified and free):

enter image description here

table for integer values

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "description": "A simple bar chart with ranged data (aka Gantt Chart).",
 "data": {"name": "dataset"},
 
  "mark": "bar",
  "encoding": {
    "y": {"field": "task", "type": "ordinal"},
    "x": {"field": "start", "type": "quantitative"},
    "x2": {"field": "end"}
  }
}

works fine

ok

but If I try use datetime values table

table with datetime

with same code

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "description": "A simple bar chart with ranged data (aka Gantt Chart).",
 "data": {"name": "dataset"},
 
  "mark": "bar",
  "encoding": {
    "y": {"field": "task", "type": "ordinal"},
    "x": {"field": "start", "type": "quantitative"},
    "x2": {"field": "end"}
  }
}

data not shown in graph :(

not ok

What is wrong ? I have idea to transfer datetime values to decimal number but this is very bad workaround. Thank for any help.

  • Related