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).
- π― About This Repository
- π Challenges by Source
- π οΈ Technologies Used
- π Challenge Index
- π Getting Started
- π€ Contributing
- π Resources
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
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
Solutions to data challenges from OMID Motamedisedeh, focusing on practical BI scenarios.
β Explore All OMID Solutions
| 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 |
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/
βββ Challenge_001/
βββ Challenge_002/
βββ ...
git clone https://github.com/CSalcedoDataBI/BI_Challenges.git
cd BI_ChallengesNavigate to any challenge folder:
cd EXCEL_BI/403_EXCEL_CHALLENGEOpen README.md to understand the problem:
cat README.md # or open in your editorjupyter notebook Excel_Challenge_403.ipynbpython solution.py- Open the
.pbixfile in Power BI Desktop - Go to Data β Transform Data
- Review the
solution.mcode in Power Query Editor
- Modify the data source paths
- Change parameters (thresholds, intervals, etc.)
- Test with your own datasets
- Compare different approaches
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%
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()- Start with Challenge 403 (ββ difficulty)
- Follow the Jupyter notebooks step-by-step
- Compare Python vs PySpark vs Power Query approaches
- Modify code and experiment
- 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
- Share your own solutions via pull requests
- Add new challenges from other communities
- Improve documentation & code comments
- Help others learn
Have a new challenge or solution? We welcome contributions!
- Fork the repository
- Create a folder:
CHALLENGE_SOURCE/NNN_DESCRIPTION/ - Add files:
README.mdβ Problem statement & your approachsolution.pyorsolution.mβ Your codefiles/β Data files & screenshots
- Push & open a Pull Request
- β 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
- π§ Email: csalcedo90@gmail.com
- πΌ LinkedIn: Cristobal Salcedo
- π Issues: GitHub Issues
- π Excel BI LinkedIn
- π Weekly Challenges
- π OMID's Profile
- π PySpark Documentation
- π Power Query (M) Reference
- π Pandas Documentation
- π Jupyter Notebooks
- π Power BI, Deneb & Fabric guides at csalcedodatabi.com β tutorials on Power BI visuals, Deneb/Vega-Lite templates and Microsoft Fabric data agents (in Spanish)
MIT License β see LICENSE for details.
You're free to use, modify, and distribute these solutions for educational and commercial purposes.
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