Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Fact table column splitting

I have a self made dataset containing Spotify playlist data. In the fact table, I have the song title with the related artist. I also have a dimension table with each artist that is included. The iss...
  • bhanu_gautam's avatar
    1 year ago

    Anonymous Go to the Power Query Editor by clicking on Transform Data.
    Select your fact table.
    Select the column that contains the comma-separated artist names.
    Go to the Transform tab, and click on Split Column > By Delimiter.
    Choose the comma (,) as the delimiter and select Each occurrence of the delimiter.
    This will split the column into multiple columns. Now, you need to unpivot these columns to create individual rows for each artist.
    Select the columns that were created from the split.
    Go to the Transform tab, and click on Unpivot Columns.
    This will create a new table where each artist is in its own row.

     

    After splitting and unpivoting, ensure that the new table has a column for the song title and a column for the artist.
    Close and apply the changes to load the transformed data back into Power BI.
    In the Model view, create a relationship between the artist column in the new fact table and the artist column in the dimension table.

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hello Anonymous ,

     

    Thank you for reaching out to Microsoft Fabric Community Forum.

    bhanu_gautam Thank you for your quick response.

     

    I've attached a PBIX file with sample data based on your scenario. Please check the steps applied in Power Query, where the Artists column in the fact table is split into rows to enable proper filtering through a slicer using the dimension table. 

     

    If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!

    Regards,
    B Manikanteswara Reddy