cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PiyushBQ
Helper I
Helper I

Show Peer Group

Hi Guys,

 

I have a list of two columns.

 

Category
SKU
FruitApple
FruitPineapple
FruitStrawberry
Vegetable

Carrot

VegetableBrinjal
VegetableCauliflower

 

I'm trying this:

 

- User Filters the SKU

- The sheet detects the parent category and lists out all the SKUs in that category

 

Example, if a user selects Apple, the sheet will list out:

 

- Apple

- Strawberry

- Pineapple

 

I've tried this in my Power BI sheet but I'm unable to get this to work.

 

Looking for some guidance.

 

Thanks in advance!

 

Piyush

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Here's a solution based on Many2Many (higher granularities).

 

https://1drv.ms/u/s!ApyQEauTSLtOgYJUerVJHKwk6ECH9Q?e=7D1Ktr

 

The last one based on Virtual Relationships is in the making...

 

Best

D

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

And here's a solution based on Virtual Relationships:

 

https://1drv.ms/u/s!ApyQEauTSLtOgYJT8ykY-OYNbPBWlA?e=l6cnr1

 

Best

D

Thanks heaps, darlove!

That solved my problem 🙂

Anonymous
Not applicable

Here's a solution based on Many2Many (higher granularities).

 

https://1drv.ms/u/s!ApyQEauTSLtOgYJUerVJHKwk6ECH9Q?e=7D1Ktr

 

The last one based on Virtual Relationships is in the making...

 

Best

D

Anonymous
Not applicable

Here's one way to do it:

https://1drv.ms/u/s!ApyQEauTSLtOgYJSRAUp1G2gUFwSHw?e=N7q7Xh

Bet there's another based on virtual relationships. I'll place a link to a file with the other way in a sec... Most likely you don't want to concatenate. You want to display this in a table, in a visual, so the file above shows you how to do it.

Best
D

Greg_Deckler
Super User
Super User

Perhaps:

 

Measure = 
    VAR __SKU = SELECTEDVALUE('Table'[SKU])
    VAR __Category = MAX('Table'[Category])
    VAR __Table = FILTER(ALL('Table'),'Table'[Category] = __Category)
RETURN
    CONCATENATEX(__Table,[SKU],",")

PBIX attached. 


@ me in replies or I'll lose your thread!!!
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Learn Power BI 2nd Edition

@Greg_Deckler I added Unichar(10) to achieve the desired result but all it's doing is vertically stacking the string, rather than placing string values in separate rows.
 
Measure =
VAR __SKU = SELECTEDVALUE('Table'[SKU])
VAR __Category = MAX('Table'[Category])
VAR __Table = FILTER(ALL('Table'),'Table'[Category] = __Category)
RETURN
CONCATENATEX(__Table,[SKU],UNICHAR(10))

Thank you for taking the time out, Greg.

This works!

Can you please guide on structuring the layout?

An output in the matrix table would be ideal. That'll allow me to display KPIs for the rivals

Example:

ItemKPI 1KPI 2
StrawberryValueValue
PineappleValueValue
AppleValueValue


Again, thanks heaps!

Helpful resources

Announcements
June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 updates!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors
Top Kudoed Authors