powerbi-models

WebJar for powerbi-models

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

powerbi-models
Last Version

Last Version

1.8.0
Release Date

Release Date

Type

Type

jar
Description

Description

powerbi-models
WebJar for powerbi-models
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/Microsoft/powerbi-models

Download powerbi-models

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/powerbi-models/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>powerbi-models</artifactId>
    <version>1.8.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/powerbi-models/
implementation 'org.webjars.npm:powerbi-models:1.8.0'
// https://jarcasting.com/artifacts/org.webjars.npm/powerbi-models/
implementation ("org.webjars.npm:powerbi-models:1.8.0")
'org.webjars.npm:powerbi-models:jar:1.8.0'
<dependency org="org.webjars.npm" name="powerbi-models" rev="1.8.0">
  <artifact name="powerbi-models" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='powerbi-models', version='1.8.0')
)
libraryDependencies += "org.webjars.npm" % "powerbi-models" % "1.8.0"
[org.webjars.npm/powerbi-models "1.8.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

powerbi-models

Build Status NPM Version NPM Total Downloads NPM Monthly Downloads GitHub tag

Contains JavaScript & TypeScript object models for Microsoft Power BI JavaScript SDK.

For each model there is a TypeScript interface, a json schema definitions, and a validation function to ensure a given object is a valid model.

Issues

Power BI Support Page

Power BI Ideas

Documentation

https://microsoft.github.io/powerbi-models

Getting Started

Install

npm install --save powerbi-models

Import

import * as models from 'powerbi-models';

Usage

Validation:

let testObject = { x: 1 };

const errors = models.validateLoad(testObject);

if(errors) {
  console.warn(errors);
}

Would output to the console:

[
  {
    message: 'accessToken is required'
  }
]

Creating filters:

const basicFilter: models.IBasicFilter = {
  target: {
    table: "Products",
    column: "Version"
  },
  operator: "In",
  values: [
    1,
    2,
    3,
    4
  ]
};

const advancedFilter: models.IAdvancedFilter = {
  target: {
    table: "Products",
    column: "Name"
  },
  logicalOperator: "Or",
  conditions: [
    {
      operator: "Contains",
      value: "Power"
    },
    {
      operator: "Contains",
      value: "Microsoft"
    }
  ]
};

Or use the constructor methods:

const advancedFilter = new models.AdvancedFilter(
  {
    table: "Products",
    column: "Name"
  },
  "Or",
  {
    operator: "Contains",
    value: "Power"
  },
  {
    operator: "Contains",
    value: "Microsoft"
  }
);

Date Formatting

Dates should be formated using ISO 8601 standard. Example: 2016-09-08T00:15:46.861Z

This is how dates are naturally serialized to JSON:

new Date().toJSON(); //=> 2016-09-08T00:15:46.861Z

An example filter using this Date format would look like the following:

{
  "$schema": "http://powerbi.com/product/schema#advanced",
  "target": {
    "table": "Time",
    "column": "Date"
  },
  "logicalOperator": "And",
  "conditions": [
    {
      "operator": "GreaterThan",
      "value": "2014-06-01T07:00:00.000Z"
    }
  ]
}
org.webjars.npm

Microsoft

Open source projects and samples from Microsoft

Versions

Version
1.8.0
1.3.2
1.2.0
1.1.0
1.0.12
1.0.8
1.0.6
1.0.3
1.0.2