Skip to content

Custom Slicer for Power BI using react and pbiviz library.

Notifications You must be signed in to change notification settings

sauurabh/Custom-Slicer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

Custom Slicer for Power BI

This repository contains a custom slicer visual for Power BI, developed using React.js and the pbiviz library. This slicer limits the number of selections and enhances the user experience by providing a more controlled and customized selection process.

Features

  • Custom Selection Limit: Restrict the number of items that can be selected in the slicer.
  • React.js Integration: Built using React.js.
  • Power BI Visualization Tools (pbiviz): Utilizes the pbiviz library for seamless integration with Power BI.

Getting Started

Prerequisites

Ensure you have the following tools installed on your development machine:

Installation

  1. Clone the repository:
    git clone https://github.com/sauurabh/Custom-Slicer.git
    cd Custom-Slicer
  2. Install dependencies:
    npm install

Development

To start the development server, run:

pbiviz start

This will build the visual and start a local server. You can then add the visual to your Power BI report by importing it as a custom visual.

Building for Production

To create a production build, run:

pbiviz package

This will generate a .pbiviz file in the dist directory, which can be imported into Power BI.

Usage

  1. Import the .pbiviz file into your Power BI report. (Inside Custom-Slicer/Dist)
  2. Add the custom slicer visual to your report.
  3. Configure the slicer settings as needed, including the maximum number of selectable items.

Project Structure

  • src/: Contains the source code for the custom slicer.
    • CustomSlicer.tsx/: React component.
    • Setting.ts/: The settings.ts file is used to define and manage the settings for your visual. These settings are configurable by the user through the Power BI interface and allow customization of the visual's appearance and behavior
    • visual.ts: The visual.ts file is the main entry point for your custom visual. It defines the behavior of the visual, including how it renders, updates, and interacts with the data.
    • transformData.ts: Extracting Data from Dataview object
  • style/:CSS and styling files.
    • visual.less/: styling file
  • capabilities.json/: The capabilities.json file defines the metadata and capabilities of your visual. It describes what kind of data the visual expects and how it can be configured. This file typically includes:
      DataViewMappings: Specifies how the data should be structured and mapped to the visual.
      Objects: Defines the customizable properties that appear in the Power BI format pane.
      DataRoles: Describes the different roles the data fields can play (e.g., Category, Measure).
      DataViewKinds: Indicates the types of data views the visual can handle (e.g., Table, Matrix).
      SupportsHighlight: Specifies whether the visual supports data highlighting.
  • assets/: Static assets such as images and icons.
  • dist/: Directory where the built visual is output.
  • package.json: Project configuration and dependencies.
  • tsconfig.json: TypeScript configuration.
  • Sample

    If maxSelection value is "n",then it will allow user to select options less than or equal to "n"

    Contributing

    Contributions are welcome! Please open an issue or submit a pull request for any changes or improvements.

    Contact

    For any questions or support, please contact saurabhss1210@gmail.com.

About

Custom Slicer for Power BI using react and pbiviz library.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages