MENU

Fun & Interesting

Advanced Power BI Project • End-to-End • ChatGPT • Custom Visuals

Power BI Park 338,687 2 years ago
Video Not Working? Fix It Now

Learn how to use Python, ChatGPT, HTML, DENEB to make this report. Join my PowerBI Classroom 💯https://www.skool.com/powerbipark/about 🟢Skip the python with the enriched Dataset: https://onyxdata.ck.page/a12261b1fb 00:00 - Intro 00:46 - Download and Enrich Dataset 05:55 - Glassmorphism Background 11:50 - Power BI 17:38 - HTML Visual 20:33 - DENEB Visuals 29:58 - Power BI Formatting I wanted this to be a step into Advanced Visualization Techniques, especially if you're a Power BI developer and haven't used them before The Video covers: 💠Enriched dataset with ChatGPT & Python 💠Glassmorphism Background 💠Power BI Building 💠HTML Cover Art 💠DENEB Visuals 💠PBI Format You want the Python code? Scroll down 👇 ================================= 🔥Code Interpreter for Data Analysis 🔗https://youtu.be/WCtjoKJdx3w?si=8N_sGWM0dFo9nH1e 🔥Power BI Backgrounds 🔗https://youtu.be/YP1Tr7nrwNI?si=P3RhJycSGspGyXpj 🔥Bravo in Power BI 🔗https://youtu.be/_NEnQNp102U?si=KC9ARXr2cE1ikCa-&t=457 🔥Ahmed's Portfolio 🔗https://photos.google.com/share/AF1QipNqulXXlB1nFDSeglnIG3ftPOY-F79O3Z3lliW6u5nvNTfHPxWd_T2sWvy0q4sG5A?key=eTFFOTdrSlJxRlRmN29iSHdMeVFLSmhfUmdqOWJn 🔥Dataset 🔗https://www.kaggle.com/datasets/nelgiriyewithana/top-spotify-songs-2023?resource=download 🔥Spotify Developer App 🔗https://developer.spotify.com/ 🔥Download Python 🔗https://www.python.org/downloads/ 🔥David's Deneb Showcase 🔗https://github.com/PBI-David/Deneb-Showcase 🔥Unit Chart Code 🔗https://stackoverflow.com/questions/75881301/convert-vega-deneb-gauge-to-work-in-powerbi 🔥Heatmap Code 🔗https://github.com/PowerBI-tips/Deneb-Templates/blob/main/templates/heatmap%20with%20bars%20-%20red%20themed.json 🔥Color Pallette 🔗https://www.color-hex.com/color-palette/53188 ================================= Looking for Power BI consulting? Reach out to me on Linkedin: 🟢https://www.linkedin.com/in/injae-park/ Thanks for taking the time to watch this video. Python code: ===================================================== import requests import pandas as pd # Function to get Spotify access token def get_spotify_token(client_id, client_secret): auth_url = 'https://accounts.spotify.com/api/token' auth_response = requests.post(auth_url, { 'grant_type': 'client_credentials', 'client_id': client_id, 'client_secret': client_secret, }) auth_data = auth_response.json() return auth_data['access_token'] # Function to search for a track and get its ID def search_track(track_name, artist_name, token): query = f"{track_name} artist:{artist_name}" url = f"https://api.spotify.com/v1/search?q={query}&type=track" response = requests.get(url, headers={ 'Authorization': f'Bearer {token}' }) json_data = response.json() try: first_result = json_data['tracks']['items'][0] track_id = first_result['id'] return track_id except (KeyError, IndexError): return None # Function to get track details def get_track_details(track_id, token): url = f"https://api.spotify.com/v1/tracks/{track_id}" response = requests.get(url, headers={ 'Authorization': f'Bearer {token}' }) json_data = response.json() image_url = json_data['album']['images'][0]['url'] return image_url # Your Spotify API Credentials client_id = 'your_client_id' client_secret = 'your_client_secret' # Get Access Token access_token = get_spotify_token(client_id, client_secret) # Read your DataFrame (replace 'your_file.csv' with the path to your CSV file) df_spotify = pd.read_csv('your_file.csv', encoding='ISO-8859-1') # Loop through each row to get track details and add to DataFrame for i, row in df_spotify.iterrows(): track_id = search_track(row['track_name'], row['artist_name'], access_token) if track_id: image_url = get_track_details(track_id, access_token) df_spotify.at[i, 'image_url'] = image_url # Save the updated DataFrame (replace 'updated_file.csv' with your desired output file name) df_spotify.to_csv('updated_file.csv', index=False) =============================================== !!!! All curly brackets need to be angled brackets - youtube restricts angled brackets in this text _Image html = Var x = CALCULATE( MAX('updated_spotify_data'[cover_url]), 'updated_spotify_data'[streams] = MAX('updated_spotify_data'[streams]) ) return " {!DOCTYPE html} {html lang='en'} {head} {meta charset='UTF-8'} {title}Image Cropping{/title} {style} .image-container { width: 458px; /* Width of the container */ height: 140px; /* Height of the container */ overflow: hidden; /* Hide parts of the image that don't fit */ border-radius: 15px; /* Rounded corners */ position: relative; /* Relative positioning for the child element */ } .image { object-fit: cover; /* Cover the entire container */ object-position: center; /* Center the image */ width: 100%; /* Full width */ height: 100%; /* Full height */ } {/style} {/head} {body} {div class='image-container'} {img src='"&x&"' alt='Album Cover' class='image'} {/div} {/body} {/html} " ======================================================= #powerbi #shortcuts #microsoft

Comment