cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MehdiB New Member
New Member

2 columns (1st/2nd choice) same values, visual = % of grand total of x in either 1st or 2nd pref

Quite new to PowerBI and having a hard time figuring out the most efficient way to do this. Would be greatful for any assistance.

Here's an exemple of what I'm trying to do:

 

Person

Favorite color

2nd favorite color

Alpha

Red

 

Bravo

Blue

Red

Charlie

Red

 

Delta

Black

Yellow

Echo

Yellow

Red

 

In the real life scenario I have 6032 ''persons'' and 25 different ''colors'' and trying to using a bar chart the represent the % of persons having x color as 1st or 2nd choice.

 

Extra info:

- The data is imported from an excel file that will be updated every month so I'm trying to stick to things done in Query.

- There IS a concentration in the top 6-7 values (~85 total%)

 

Most efficient solution I see:

 

Creating custom columns in query like

If ‘‘Favorite color column’’ = RED or ‘‘2nd favorite color column’’, then = YES, or else = NO

And then repeating the step for the top 10ish values, but that means 10 columns.

This solution is very far from efficient and / or intelligent, anyone with anything better to get to my end result ?

 

Thanks in advance, 

Med

1 REPLY 1
butlerjay87 Frequent Visitor
Frequent Visitor

Re: 2 columns (1st/2nd choice) same values, visual = % of grand total of x in either 1st or 2nd pref

Have you tried to pivot or unpivot the data in Query Editor?

Helpful resources

Announcements
Coming Soon: T-Shirt Design Contest

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors
Top Kudoed Authors