Forum Discussion

SamFletch's avatar
SamFletch
Helper I
5 years ago
Solved

Unsure how to work with data format provided

Hello all,

 

I've been given some data to play with for a report but I'm struggling how to actually make any good use of it. I've come up with an example of what the data looks like below and was hoping someone could advise what the best course of action is.

 

Let's say, for example, I'm selling balls and want to track what colour is sold each day. I've been given a table that looks like this:

 

 Colour   
 RedGreenBlueYellow
01/01/214102
02/01/212882
03/01/210023

 

Looking at the table I've made I can see that I've sold 6 balls on 01/01/21 (4 red, 1 green, 0 blue, 2 yellow), 20 on the 2/01/21 and so on.

 

There's a lot I can do with this data but what I'm really struggling with is creating a filter based on the actual colour of the ball, as Power BI sees the columns as their own distinct catergory, rather than related to each other. 

 

I'm struggling to figure out if it's something that I can fix within Power BI or whether it's something I need to change with the source data. I've played with the Unpivot option and whilst this shows promise, in my scenario I actually have closer to 40 different columns and data dating back 3 years. I'm worried that unpivoting is just going to break due to the hundreds of thousands of rows that will generate.

 

If anyone can advise, it would be a massive help.


Thank you.

 

 

  • SamFletch,

     

    You're on the right track with unpivoting columns. If your data source is a database, you can perform this operation in the database. If not, I would proceed with unpivoting columns in Power Query and see how it performs.

1 Reply

  • SamFletch,

     

    You're on the right track with unpivoting columns. If your data source is a database, you can perform this operation in the database. If not, I would proceed with unpivoting columns in Power Query and see how it performs.