Learn how to use Python, ChatGPT, HTML, DENEB to make this report.
🟢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
These techniques are powerful tools to add to your kit.

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

47件のコメント

  1. Thanks for sharing knowledge.. I Need Help ‘how to show the last refresh date on dashboard.. need date from power bi service schedule refresh date.

  2. Hello, i have a question. Is this real time? I mean, once i refresh my PBI desktop report, it will get all the updates?

  3. Hi guys! Lemme ask you something. After publishing the report in the web, did have any issue? I used the Deneb visual in one the report I am building, and after publishing it on the service, it does not display the gradient color. Anyone knows why?

  4. Can i use this project as a portfolio project for my job hunt as a data analyst or will I not be able to use it as it is made by someone else and I am just coying it.

    Please reply.

  5. Cant wait to try it ,is there any links or data or code i need other than those mentioned in the description. i have connected with you on linked in for the lovely work you do

  6. Not sure if I will ever use those advanced techiniques. But, many thanks for sharing your skills without asking anything in return. This is a great Power BI visual training.

  7. I am facing a problem with the deneb visual, while in VEGA creating empty when i paste the Heat map code from git hub and changing measure name, my whole power bi screen goes blank and only shows back to report button, please resolve my problem.

  8. Wow! Impressive. Now it's time for me to practice because nothing is easy.
    Can you please add Chapter in your video? That's really important to navigate, especially for such a long video

  9. one of the most valuable presentations so far. Please do more of this. Thank you for your dedication!

  10. Great video, very informative. Only got the free Chat-GPT, so decided just to use the code provided above, if anyone else gets an indentation error, you can use the free version of Chat GPT to format to code to correct the structure. Also I got the following error: KeyError: 'artist_name'. On closer inspection of the data set, artist_name is actually "artist(s)_name". If you correct this in line 52, it should fix the problem.

  11. Thanks for sharing

    How much it will take time for preparing updated_file.csv?

    When I write command like Python SpotifyScript.py ….then it took too much time and then nothing happens… can't able to create updated_file.. any suggestions

  12. Superbly done!🤩
    How do you get the right option pane (from where you selected the format pane or selection pane) in your PowerBI? How can I get that in my Power BI?

  13. It's amazing but unfortunately I'm not on that level right now and you didn't have any videos on your channel for beginners.

  14. On the track image like blinding light html content, im getting a slicer which is shifting the picture to left and right, up and down. How to fix it?

  15. sir can you please help me with the urls the code is really not working and i really want to do this project please reply as soon as possible will be the happiest person if you guide me through ig or something thankyou

  16. Great video, very informative. I am not able to find designer section in my PowerPoint. Please help me

  17. When I tried the html code and tried to click on Image html, its not working, no image shows up, it says image html on a a blank white screen. Am I missing anything? I even changed the data category of cover_url to Image URL and the image shows in that column but not in the above step as shown.

  18. I thoroughly enjoyed watching this video. It's not every day that you come across advanced projects like this available for free on the web. However, I do have a request. I currently only have access to GPT-3.5, and I find it a bit challenging to work with code. Could you please share the code with me?

  19. Hey @Power BI Park I'm facing a problem at Deneb Heatmap where it's not showing the heat map even though I changed the name of track measure multiple times… any thoughts on why this is happening ???

  20. Fantastic video. Just a question,
    I want to create a report like that for my company, being more specific, for the connectivity department. Do you know if is possible to use Python if my datasource comes from Sharepoint?
    I also want to know if make sense to create a report like that using Deneb function for any type of report.. I mean there is always a possibility to structure my data to fit with these type of visuals?

    In my personal case, I need to represent the launching dates of each site within specific technology.

    Thank you very much

  21. The image size for album cover does not fit the window size in the html window I tried even at 45% and higher pixels for W & H.

  22. Cannot for the life of me get this to work. The heat map doesn't recognise my measure. so fustrating haha. just following the steps.

Leave A Reply