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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Reformatting messy data

Stop me if you've heard this one...

I've received an Excel spreadsheet from a user who wants to know if their data can be visualized in Power BI. The structure is set up for data entry rather than analysis, with 2 column dimensions and 2 row dimensions.  I'm trying to figure out the easiest way to get it into dimension-fact format. Here's the structure:

  NameNameNameQuestQuestQuestFavorite ColorFavorite ColorFavorite Color
TopicSubtopicYesterdayTodayTomorrowYesterdayTodayTomorrowYesterdayTodayTomorrow
Topic ASubtopic L424452224
Topic ASubtopic M214233112
Topic ASubtopic N125222331
Topic ASubtopic O135544215
Topic BSubtopic P414524222
Topic BSubtopic Q512345441
Topic CSubtopic R442155515
Topic CSubtopic S414322223
Topic CSubtopic T123523431
Topic CSubtopic U534213252

 

I've tried multi-step unpivot using Power Query/M, but that didn't get me to tidy data.

Before I redo everything manually, I figured I'd ask the experts. Any help/advice would be greatly appreciated, even if the answer is "You can't get there from here."

1 ACCEPTED SOLUTION
KNP
Super User
Super User

I think I get what you're trying to get to.

Have a look at the attached PBIX and let me know if you have any questions.

(apologies, it's a little rushed so I haven't renamed the steps or tidied up any of the code)

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
xOIEmaj

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
image
fabric-SUbadge
Proud to be a Super User!

View solution in original post

2 REPLIES 2
KNP
Super User
Super User

I think I get what you're trying to get to.

Have a look at the attached PBIX and let me know if you have any questions.

(apologies, it's a little rushed so I haven't renamed the steps or tidied up any of the code)

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
xOIEmaj

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
image
fabric-SUbadge
Proud to be a Super User!
Anonymous
Not applicable

Wow! It does just what I need. I'll need to study this a while to understand how you decomposed and recomposed the original table. Amazing.

Thank you so much!

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors