Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

126 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“Š BI Challenges | Real-World Data Solutions

GitHub stars Forks License: MIT Python PySpark Power Query

Collection of solutions to real-world Excel & BI challenges from Excel BI community. Learn how to solve complex data problems using Python, PySpark, and Power Query (M).


πŸ“– Table of Contents


🎯 About This Repository

This repository documents solutions to community-driven BI challenges:

βœ… Challenges from Excel BI β€” Official Excel challenge problems
βœ… Challenges from OMID β€” Data transformation & analysis problems
βœ… Multiple Solution Approaches β€” Python, PySpark, Power Query (M)
βœ… Complete Documentation β€” Problem statement + step-by-step solution
βœ… Runnable Notebooks β€” Jupyter notebooks & Power Query scripts included
βœ… Real Data Sets β€” Actual data files for testing & learning

Learning Goals:

  • Master data transformation techniques
  • Compare solution approaches (Python vs PySpark vs M)
  • Understand distributed computing with Spark
  • Optimize query performance

πŸ“‚ Challenges by Source

πŸ† Excel BI Challenges

The Excel BI Community publishes weekly Excel challenges on LinkedIn. This section contains my solutions.

Challenges Included:

# Challenge Problem Solutions Difficulty
403 Excel Challenge 403 Generate 5-year intervals with cumulative sums and percentages PySpark ⭐⭐
410 Excel Challenge 410 Optimize complex data queries using Power Query M Language ⭐⭐⭐
416 Excel Challenge 416 Generate sequences from strings (numeric patterns) PySpark + Python ⭐⭐⭐⭐

β†’ Explore All Excel BI Solutions


πŸ‘€ OMID Challenges

Solutions to data challenges from OMID Motamedisedeh, focusing on practical BI scenarios.

β†’ Explore All OMID Solutions


πŸ› οΈ Technologies Used

Technology Purpose Examples
Python Data cleaning, analysis, scripting Pandas, NumPy, data processing
PySpark Distributed processing at scale Large datasets, transformations
Power Query (M) ETL in Excel/Power BI Complex queries, merges, pivots
Jupyter Notebooks Interactive learning & documentation Step-by-step problem solving
Git Version control & collaboration Tracking solutions

πŸ“‹ Challenge Index

EXCEL_BI/

EXCEL_BI/
β”œβ”€β”€ 403_EXCEL_CHALLENGE/
β”‚   β”œβ”€β”€ README.md                 # Challenge statement & approach
β”‚   β”œβ”€β”€ Excel_Challenge_403.ipynb # PySpark solution in Jupyter
β”‚   β”œβ”€β”€ files/
β”‚   β”‚   β”œβ”€β”€ Excel_BI.png          # Challenge screenshot
β”‚   β”‚   └── data.xlsx             # Sample data
β”‚   └── solution.py               # Python/PySpark code
β”‚
β”œβ”€β”€ 410_EXCEL_CHALLENGE/
β”‚   β”œβ”€β”€ README.md
β”‚   β”œβ”€β”€ Power_Query_Solution.m    # M language code
β”‚   └── files/
β”‚       └── Challenge_410.pbix    # Power BI example
β”‚
└── 416_EXCEL_CHALLENGE/
    β”œβ”€β”€ README.md
    β”œβ”€β”€ Sequence_Generator.ipynb  # Multi-approach solution
    └── files/
        └── sequences_output.csv

OMID_BI/

OMID_BI/
β”œβ”€β”€ Challenge_001/
β”œβ”€β”€ Challenge_002/
└── ...

πŸš€ Getting Started

1️⃣ Clone the Repository

git clone https://github.com/CSalcedoDataBI/BI_Challenges.git
cd BI_Challenges

2️⃣ Choose a Challenge

Navigate to any challenge folder:

cd EXCEL_BI/403_EXCEL_CHALLENGE

3️⃣ Read the Documentation

Open README.md to understand the problem:

cat README.md  # or open in your editor

4️⃣ Run the Solution

Option A: Jupyter Notebook (Interactive)

jupyter notebook Excel_Challenge_403.ipynb

Option B: Python Script (Quick)

python solution.py

Option C: Power Query (In Power BI)

  1. Open the .pbix file in Power BI Desktop
  2. Go to Data β†’ Transform Data
  3. Review the solution.m code in Power Query Editor

5️⃣ Explore & Adapt

  • Modify the data source paths
  • Change parameters (thresholds, intervals, etc.)
  • Test with your own datasets
  • Compare different approaches

πŸ’‘ Example: Challenge 403 Walkthrough

Problem Statement

Generate the sum and percentage for 5-year intervals from a year-value dataset.

Input:

Year  | Value
------|-------
1990  | 100
1992  | 150
2000  | 200
2005  | 300
2015  | 400

Expected Output:

Year Group | Sum of Value | % of Value
-----------|--------------|----------
1990-1994  | 250          | 14%
1995-1999  | 0            | 0%
2000-2004  | 200          | 11%
2005-2009  | 300          | 17%
2010-2014  | 0            | 0%
2015-2019  | 400          | 23%
Grand Total| 1750         | 100%

Solution: PySpark Approach

from pyspark.sql import SparkSession
from pyspark.sql.functions import col, floor, sum as _sum, round

spark = SparkSession.builder.appName("Challenge_403").getOrCreate()

# Load data
df = spark.read.csv("data.csv", header=True)

# Calculate 5-year intervals
df_grouped = df.withColumn(
    "YearGroup", 
    ((col("Year") - 1990) / 5).cast("int") * 5 + 1990
).groupBy("YearGroup").agg(_sum("Value").alias("Sum_Value"))

# Calculate percentages
total = df_grouped.agg(_sum("Sum_Value")).collect()[0][0]
df_result = df_grouped.withColumn(
    "Percent", 
    round((col("Sum_Value") / total) * 100, 0)
)

df_result.show()

β†’ Full walkthrough β†’


πŸ“š How to Use This Repository

For Learning

  • Start with Challenge 403 (⭐⭐ difficulty)
  • Follow the Jupyter notebooks step-by-step
  • Compare Python vs PySpark vs Power Query approaches
  • Modify code and experiment

For Reference

  • Use solution patterns for your own projects
  • Adapt SQL/PySpark queries for similar problems
  • Learn Power Query (M) idioms and best practices
  • See how to structure complex data workflows

For Community

  • Share your own solutions via pull requests
  • Add new challenges from other communities
  • Improve documentation & code comments
  • Help others learn

🀝 Contributing

Have a new challenge or solution? We welcome contributions!

How to Contribute

  1. Fork the repository
  2. Create a folder: CHALLENGE_SOURCE/NNN_DESCRIPTION/
  3. Add files:
    • README.md β€” Problem statement & your approach
    • solution.py or solution.m β€” Your code
    • files/ β€” Data files & screenshots
  4. Push & open a Pull Request

Guidelines

  • βœ… Include the original problem statement (with source link)
  • βœ… Document your approach & logic
  • βœ… Provide runnable code (Jupyter or Python script)
  • βœ… Add sample data or instructions to get it
  • βœ… Show expected output with screenshots
  • βœ… Compare multiple approaches if applicable

πŸ“ž Support & Questions


πŸ“š Resources

Excel BI

OMID BI

Tools & Documentation


πŸ“„ License

MIT License β€” see LICENSE for details.

You're free to use, modify, and distribute these solutions for educational and commercial purposes.


🌟 Show Your Support

If these solutions help your learning journey:

⭐ Star this repository β€” Help others find it
πŸ”„ Fork & contribute β€” Add your own solutions
πŸ’¬ Share feedback β€” Tell us what you'd like


Made with ❀️ by Cristobal Salcedo

Powered by Python, PySpark & Power Query

About

πŸš€ Repositorio de soluciones a retos de comunidades en Pyspark 🐍, Python, y lenguaje {M} de Power Query πŸ” para anΓ‘lisis y consultas de datos.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages