Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

29 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎡 Spotify Track Intelligence

A full end-to-end data analytics project built using MySQL and Power BI, analyzing 114,000 Spotify tracks across 114 genres to uncover music trends, audio patterns, and popularity insights.


πŸ“Έ Dashboard Preview

Page Description
Page 1 Overview β€” KPIs, top artists, genre treemap
Page 2 Genre Analysis β€” Popularity, audio features by genre
Page 3 Track Deep Dive β€” Top tracks, tempo, valence vs energy
Page 4 Track Intelligence Hub β€” Search & filter any song

πŸ“Š Project Overview

This project takes raw Spotify track data, loads it into a MySQL database, connects it to Power BI, and builds a 4-page interactive dashboard that answers:

  • Which artists and genres are most popular?
  • What audio features make a song a hit?
  • How do genres differ in energy, danceability, and mood?
  • How can we search and explore any track instantly?

πŸ”„ Data Flow

flowchart TD
    subgraph SRC["πŸ“¦ Source"]
        A["Kaggle Dataset<br/>Spotify Tracks Dataset<br/>114,000 rows Γ— 21 cols"]
    end

    subgraph DB["πŸ—„οΈ MySQL 8.0"]
        B["dataset.csv"]
        C["create_table.sql<br/>(schema definition)"]
        D["load_data.sql<br/>(bulk load via<br/>secure file path)"]
        E[("spotify_db<br/>Spotify Tracks table")]
    end

    subgraph ETL["πŸ”„ Power Query Transformations"]
        F["duration_ms β†’ duration_min"]
        G["explicit: 0/1 β†’ Clean/Explicit"]
        H["popularity_tier:<br/>Low / Medium / High"]
        I["Trim whitespace<br/>(artists, track_name, album_name)"]
        J["Remove duplicate track_id"]
        K["Fix numeric data types"]
    end

    subgraph DAX["πŸ“ DAX Measures"]
        L["Total Tracks, Avg Popularity,<br/>Explicit %, Total Genres,<br/>Avg Duration Min"]
    end

    subgraph BI["πŸ“Š Power BI Dashboard (Spotify.pbix)"]
        M["Page 1: Music Overview<br/>KPIs, Top Artists, Genre Treemap"]
        N["Page 2: Genre Analysis<br/>Popularity & Audio Features by Genre"]
        O["Page 3: Track & Artist Deep Dive<br/>Top Tracks, Tempo, Valence vs Energy"]
        P["Page 4: Track Intelligence Hub<br/>Search & Filter any Track"]
    end

    A --> B
    C -->|1. creates schema| E
    B --> D
    D -->|2. inserts data into schema| E
    E -->|MySQL Connector/NET| F
    F --> G --> H --> I --> J --> K
    K --> L
    L --> M
    L --> N
    L --> O
    L --> P
Loading

πŸ—ƒοΈ Dataset

  • Source: Spotify Tracks Dataset (Kaggle)
  • File: dataset.csv
  • Size: 114,000 rows Γ— 21 columns
  • Key columns: track_name, artists, track_genre, popularity, danceability, energy, tempo, valence, explicit, duration_ms

πŸ› οΈ Tech Stack

Tool Purpose
MySQL 8.0 Database storage and querying
MySQL Workbench Database management
Power BI Desktop Dashboard creation
Power Query Data transformation
DAX Calculated measures

πŸš€ Setup Instructions

Step 1 β€” Clone the Repository

git clone https://github.com/vedant-kawale-27/spotify-track-intelligence-powerbi-mysql.git
cd Spotify-Track-Intelligence

Step 2 β€” Set Up MySQL Database

Open create_table.sql in MySQL Workbench and run the query.

Step 3 β€” Load the Dataset

Copy dataset.csv to your MySQL secure file path: 'C:/ProgramData/MySQL/MySQL Server 8.0/Uploads/'

Open load_data.sql in MySQL Workbench and run the query.

Step 4 β€” Connect Power BI to MySQL

  1. Install MySQL Connector/NET from https://dev.mysql.com/downloads/connector/net/
  2. Open Power BI Desktop
  3. Home β†’ Get Data β†’ MySQL Database
  4. Server: localhost | Database: spotify_db
  5. Select: Database β†’ Enter: User name & Password β†’ Connect
  6. Click Transform Data

Step 5 β€” Open the Dashboard

Open Spotify.pbix in Power BI Desktop β€” all visuals load automatically.


πŸ”§ Power Query Transformations Applied

  • Converted duration_ms β†’ duration_min (milliseconds to minutes)
  • Replaced explicit values: 0 β†’ Clean, 1 β†’ Explicit
  • Added popularity_tier column: Low / Medium / High
  • Trimmed whitespace from artists, track_name, album_name
  • Removed duplicate track_id entries
  • Changed data types for all numeric columns

πŸ“ DAX Measures

Total Tracks = COUNTROWS('Spotify Tracks')

Avg Popularity = ROUND(AVERAGE('Spotify Tracks'[popularity]), 2)

Explicit Tracks = COUNTROWS(FILTER('Spotify Tracks', 'Spotify Tracks'[explicit] = "Explicit"))

Explicit % = ROUND(DIVIDE([Explicit Tracks], [Total Tracks]) * 100, 1)

Total Genres = DISTINCTCOUNT('Spotify Tracks'[track_genre])

Avg Duration Min = ROUND(AVERAGE('Spotify Tracks'[duration_min]), 2)

πŸ“„ Dashboard Pages

Page 1 β€” Music Overview

  • 5 KPI Cards: Total Tracks, Avg Popularity, Explicit %, Total Genres, Avg Duration
  • Top 10 Artists by Track Count (Bar Chart)
  • Popularity Distribution: Low / Medium / High (Column Chart)
  • Explicit vs Clean split (Donut Chart)
  • Tracks by Genre (Treemap)

Page 2 β€” Genre Analysis

  • Avg Popularity by Genre (Horizontal Bar Chart)
  • Energy vs Popularity by Genre (Scatter Plot)
  • Audio Features by Genre: Danceability, Energy, Valence, Acousticness (Clustered Bar)
  • Genre Slicer (Dropdown)

Page 3 β€” Track & Artist Deep Dive

  • Top 10 Tracks by Popularity (Table with conditional formatting)
  • Danceability vs Popularity (Scatter Plot)
  • Avg Tempo by Genre (Column Chart)
  • Valence vs Energy mood map (Scatter Plot)
  • Slicers: Genre, Explicit, Popularity Tier

Page 4 β€” 🎼 Track Intelligence Hub

  • Search by Track Name (Text Slicer)
  • Search by Artist (Text Slicer)
  • Filter by Genre (List Slicer)
  • Explicit Filter (Tile Slicer)
  • Popularity Range (Between Slider)
  • Results Table: track_name, artists, genre, popularity, explicit, duration_min
  • Detail Cards: Avg Danceability, Avg Energy, Avg Tempo, Avg Duration

πŸ“‚ File Structure

Spotify-Track-Intelligence/
β”‚
β”œβ”€β”€ dataset/
β”‚   └── dataset.csv
β”‚
β”œβ”€β”€ database/
β”‚   β”œβ”€β”€ create_table.sql
β”‚   └── load_data.sql
β”‚
β”œβ”€β”€ dashboard/
β”‚   └── Spotify.pbix
|   └── Spotify.pdf
β”‚
β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ Spotify_page-0001.jpg
β”‚   β”œβ”€β”€ Spotify_page-0002.jpg
β”‚   β”œβ”€β”€ Spotify_page-0003.jpg
β”‚   └── Spotify_page-0004.jpg
β”‚
β”œβ”€β”€ README.md
|
└── LICENSE

πŸ’‘ Key Insights from the Dashboard

  • Pop-film, K-pop, and Chill are the most popular genres on average
  • The Beatles, George Jones, and Stevie Wonder have the most tracks in the dataset
  • Only 8.6% of tracks are explicit β€” most content is clean
  • Songs with higher danceability tend to have moderately higher popularity
  • Grunge and Sertanejo genres have the highest average tempo

πŸ™Œ Author

Vedant Kawal

  • Built with MySQL + Power BI
  • Dataset: Spotify Tracks (Kaggle)
  • Tools: MySQL Workbench 8.0, Power BI Desktop

πŸ“œ License

This project is open source under the MIT License.

About

🎧 What makes a song a hit? Exploring 114K Spotify tracks with MySQL & Power BI

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages