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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
MehdiB
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
Helper I
Helper I

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.