fredrikheden / summarytable

Summary Table Custom Visual for Power BI
33 stars 17 forks source link

Summary Table Power BI Custom Visual

The summary table is a custom visual that allows you to define tables in Power BI with summary rows and custom styling. The most common scenario for using this custom visual is to create the an income statement report.

The above image shows a summary table with an income statement with two summary levels.

The abone image shows a summary table with an income statement with yellow highlighting.

The JSON structure

{
    "columns": [...],
    "rows": [...],
    "headerRow": {...},
    "displayAllRows": true/false,
    "additionalWidth": 5, // Obsolete from version 2.0.0
    "reusableCSS" : [
        {
            "key": "#blackbackground#",
            "value": "background-color:#000;color:#fff"
        }
    ],
    "masterHeader": {
        "title": "Master header of table",
        "headerStyle": "background-color:#000000;color:#fff;padding:5px",
        "borderStyle": "border:1px solid #000000"
    },
    "culture": "en-US",
    "alternatingRowStyle": "background-color:#F8FaFd"
}

Define columns - columns

Example

{
    "headerStyle": "text-align:left",
    "rowStyle": "text-align:left",
    "width": 260,
    "type": "RowHeader",
    "refName": "[AccountGroup]", 
    "title": "Amounts in k$",
    "calculationFormula": "", 
    "format": "",
    "hidden": false,
    "styeByMeasure": "[AccountGroupStyle]"
}

Properties

Define rows - rows

Example

{
    "title": "Total revenues",
    "formula": "[Operating revenues]+[Other revenues]",
    "rowStyle": "font-weight:bold;font-size:small;",
    "visible": true,
    "cellRowHeaderStyle": "",
    "cellRowDataStyle": "",
    "format": "",
    "hideForColumns": ["[Amount]"],
    "directColumnRef": [
        {
                "columnRefName": "[Budget]",
                "columnReplaceRefName": "[Custom measure %]"
        }
    ]
}

Properties

Define header row style - headerRow

Example

"headerRow": {
    "rowStyle": "background-color:#aaa"
}

Properties

Known issues & limitations