Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Mahmoud23
Regular Visitor

Need Help with data

artists.JPG

Help with data.

I have a data table from Spotify that contains a column recording the number of artists, and some cells have more than one artist. I want a function or method to create a card that shows the correct total number of artists and is also interactive when I use filters. For example, if I select a song with three artists, the card should display three.

Can I create a separate table and how do I link it to the original table? When I created the relationship, the one-to-many setup is correct, but the card does not interact.

I have attached an example of part of the table, and I may provide a link to the full data

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks for the reply from parry2k , please allow me to provide another insight:
Hi  @Mahmoud23 ,

I couldn't open your pbix link, I created my own relevant sample data:

vyangliumsft_0-1727162879410.png

Here are the steps you can follow:

1. Duplicate the table in Power Query, delete columns for splitting into multiple columns, select all columns for Unpivot Columns.

Select [track_name] -- Remove

vyangliumsft_1-1727162879411.png

Table_copy – select [act_name] – Split column – By Delimiter.

vyangliumsft_2-1727162908372.png

vyangliumsft_3-1727162908373.png

Select all columns – Unpivot Columns.

vyangliumsft_4-1727162927729.png

Select [Attribute] – Remove.

vyangliumsft_5-1727162927730.png

Select [Value] – Duplicate Column.

vyangliumsft_6-1727162946429.png

vyangliumsft_7-1727162946429.png

2. Create measure.

Measure =
var _select=SELECTEDVALUE('Table'[track_name])
var _art=MAXX(FILTER(ALL('Table'),'Table'[track_name]=_select),[art_name])
var _table=
FILTER('Table_copy',CONTAINSSTRING(_art,[Value])=TRUE())
var _table2=
ADDCOLUMNS(
    _table,"Count",COUNTX(FILTER(ALL('Table'),CONTAINSSTRING('Table'[art_name],[Value])=TRUE()),[track_name]))
return
CONCATENATEX(_table2,[Value]&"-"&[Count]," ")

3. Result:

vyangliumsft_8-1727162964868.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Thanks for the reply from parry2k , please allow me to provide another insight:
Hi  @Mahmoud23 ,

I couldn't open your pbix link, I created my own relevant sample data:

vyangliumsft_0-1727162879410.png

Here are the steps you can follow:

1. Duplicate the table in Power Query, delete columns for splitting into multiple columns, select all columns for Unpivot Columns.

Select [track_name] -- Remove

vyangliumsft_1-1727162879411.png

Table_copy – select [act_name] – Split column – By Delimiter.

vyangliumsft_2-1727162908372.png

vyangliumsft_3-1727162908373.png

Select all columns – Unpivot Columns.

vyangliumsft_4-1727162927729.png

Select [Attribute] – Remove.

vyangliumsft_5-1727162927730.png

Select [Value] – Duplicate Column.

vyangliumsft_6-1727162946429.png

vyangliumsft_7-1727162946429.png

2. Create measure.

Measure =
var _select=SELECTEDVALUE('Table'[track_name])
var _art=MAXX(FILTER(ALL('Table'),'Table'[track_name]=_select),[art_name])
var _table=
FILTER('Table_copy',CONTAINSSTRING(_art,[Value])=TRUE())
var _table2=
ADDCOLUMNS(
    _table,"Count",COUNTX(FILTER(ALL('Table'),CONTAINSSTRING('Table'[art_name],[Value])=TRUE()),[track_name]))
return
CONCATENATEX(_table2,[Value]&"-"&[Count]," ")

3. Result:

vyangliumsft_8-1727162964868.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Mahmoud23
Regular Visitor

https://docs.google.com/spreadsheets/d/16qDlNKnisbS_NyLqz7d8yrOo2wK5xInl/edit?usp=sharing&ouid=10520... 

 

Help me please!

I have a data table from Spotify that contains a column recording the artists & another the number of artists, and some cells have more than one artist. I want a function or method to create a card in power bi that shows the correct total number of artists and is also interactive when I use filters. For example, if I select a song with three artists, the card should display three.

Can I create a separate table and how do I link it to the original table? When I created the relationship, the one-to-many setup is correct, but the card does not interact.

I  provided a link to the full data. 

& in your opinion, what are the best additional modifications i can make to this data to extract good results that i can use in a power bi report.

@Mahmoud23 duplicate post - I already replied to the original post/



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

I Attached the data in a new post as the first solution didn't work with me 

parry2k
Super User
Super User

@Mahmoud23 provide more details, what didn't work? Your reply is not helpful what is not working?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@Mahmoud23 there are few approaches on how you can solve it?

 

One approach is:

 

- add an index column to the table - calling track table

- refer to track table (after the index column is added), let's call it artist table

- remove all other columns except index and artist column from artist table

- split artist column by delimiter (comma) and under advance options (of split dialog box), select rows

- close and apply

 

now you have two tables one is called title and the other is artist. set relationship between title and artist tables on the index column, and set the cross filter direction to both (not recommended but for testing let's do it)

 

visualize your data, and in the slicer use artist column from the artist table, as you select different artists, it will show track based on the select artists (or visual will be interactive)

 

Hope this helps, tweak the solution as you see fit.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Thanks but i already did that way & That didn't Work 😓

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors