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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Column Header is a Date, but the content of Column is a value - How to reflect this in a histogram

Hi Folks, 

 

Wondering if someone can help.  I have an export of data from Primavera P6 in excel format.

 

Six of the columns contain text data, and the remaining columns headers are dates with the data for each entered.  See below screen shot.

 

I want to create a histogram, along the bottom axis should be the date, then stacked should be the Department with the a count of all data within that date against the department.

 

I am struggling to create this and wondered if someone could help point me in the right direction to where I am going wrong - the issue appears to be the date column being the headers and numerical values being held within the date (for reference the data is man hours held under each date)

 

data.JPG

 

 

1 ACCEPTED SOLUTION
mauriciosotero
Resolver III
Resolver III

Hi,

 

In fact, the best practice is to transform theses Date columns in two: Date and Value (or a better name).

 

For that, firs you have to unpivot the date columns:

1) Go to query editor;

2) Select the date columns;

3) Choose the options Transform--> Unpivot Columns --> Unpivot the selected columns:

 

Capture2.PNG

 

The result will be:

 

Capture3.PNG

 

 

After, you have to modify the type of the new column date (in my example the "Atribute" column) to Date.

 

And that it! Chose and apply the changes and you will be able to do your visuals.

 

If this helps, I apreciate you give a kudo and mark as the solution. Thanks

View solution in original post

4 REPLIES 4
mauriciosotero
Resolver III
Resolver III

Hi,

 

In fact, the best practice is to transform theses Date columns in two: Date and Value (or a better name).

 

For that, firs you have to unpivot the date columns:

1) Go to query editor;

2) Select the date columns;

3) Choose the options Transform--> Unpivot Columns --> Unpivot the selected columns:

 

Capture2.PNG

 

The result will be:

 

Capture3.PNG

 

 

After, you have to modify the type of the new column date (in my example the "Atribute" column) to Date.

 

And that it! Chose and apply the changes and you will be able to do your visuals.

 

If this helps, I apreciate you give a kudo and mark as the solution. Thanks

Anonymous
Not applicable

In the event that the dates change in another dataset, this query will break. Is there a workaround for that?

Anonymous
Not applicable

Thank you so much! it worked.

Welcome!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.