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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
RaptorFox
Frequent Visitor

Convert dynamic amount of date rows to columns

Dear community

 

I have multiple CSV blobs in a particular storage container. Those are pulled from our backup system once a week for the last seven days. Each row indicates the system to be backed up, and then n-amount of date-named columns show if the backup was successful on this particular date (1) or not (0).

 

situation_display.jpg

 

I need to be able to use date slicers in my dashboard and provide an easy overview. Therefore, i need one row per system per date for the dynamic amount of dates (columns) like this:

 

situation_display_target.jpg

 

I now tried 3 hours, and need to give up. How can i do this conversion in the easiest way?

 

Thank you very much for any help! 

1 ACCEPTED SOLUTION
AlexanderPrime
Solution Supplier
Solution Supplier

Hi there. 

Have you tried in Power Query selecting all the columns except the System Column and then using the "Unpivot Columns" function?

Doing that should give you an output like this:

 

AlexanderPrime_0-1656053074013.png

Then you'd just need to rename the 2 columns it created and you should be good to go. 


Please note - I am not affiliated with Microsoft, I'm just an end user like yourself.
Just a regular guy doin' Data Science.

If my post has helped you, please don't forget to thumbs up or click "Accept as solution" if it solved your problem!

View solution in original post

2 REPLIES 2
RaptorFox
Frequent Visitor

Thank you very much, it worked perfectly! 

AlexanderPrime
Solution Supplier
Solution Supplier

Hi there. 

Have you tried in Power Query selecting all the columns except the System Column and then using the "Unpivot Columns" function?

Doing that should give you an output like this:

 

AlexanderPrime_0-1656053074013.png

Then you'd just need to rename the 2 columns it created and you should be good to go. 


Please note - I am not affiliated with Microsoft, I'm just an end user like yourself.
Just a regular guy doin' Data Science.

If my post has helped you, please don't forget to thumbs up or click "Accept as solution" if it solved your problem!

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.