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
Sam_Bolsover
Frequent Visitor

How to handle data source column headers changing?

Hi,

 

Each month I recieve a .csv file where each row represents a material that we order from a supplier and columns 7 and onwards represent the forcast for each month, starting with the current month. Example below.

 

MaterialDescriptionUomVendor MaterialWarehouseOrd TypeJun-21Jul-21
8000023T/SEAL EA  On Order1200
8000023T/SEAL EA  Planned0200
A41-1L1L PIS POS TTEA  On Order0100

 

Next month I will get a new file that starts with 'Jul-21'. I would like to make it so any visuals I create using this data can handle the change and still accurately display the column headers.

 

An ideal solution for me would be a way to refer to a column in a query by column number instead of by name in DAX, but any other workarounds would be much appreciated. 

1 ACCEPTED SOLUTION
v-stephen-msft
Community Support
Community Support

Hi @Sam_Bolsover ,

 

It is suggested to unpivot two column in Power Query, then select the attribute field for you title.

Screenshot 2021-06-08 110317.pngScreenshot 2021-06-08 110328.pngScreenshot 2021-06-08 110437.pngScreenshot 2021-06-08 110444.png

Reference:https://support.microsoft.com/en-us/office/unpivot-columns-power-query-0f7bad4b-9ea1-49c1-9d95-f5882... 

https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-conditional-format-visual-titles#se...

 

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

8 REPLIES 8
v-stephen-msft
Community Support
Community Support

Hi @Sam_Bolsover ,

 

It is suggested to unpivot two column in Power Query, then select the attribute field for you title.

Screenshot 2021-06-08 110317.pngScreenshot 2021-06-08 110328.pngScreenshot 2021-06-08 110437.pngScreenshot 2021-06-08 110444.png

Reference:https://support.microsoft.com/en-us/office/unpivot-columns-power-query-0f7bad4b-9ea1-49c1-9d95-f5882... 

https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-conditional-format-visual-titles#se...

 

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks Stephen,

 

I think this approach can get me what I want if display the data as a matrix instead of a table. 

 

Best regards,

Sam Bolsover

As I suggested, you're going to want to choose 'Unpivot other columns' if you want the solution to be dynamic. If you choose unpivot columns it will break when a new month of data comes in. 

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 ;).
chrome-9xf-Zagzel-B

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.
KIfp67uy-Sr
Proud to be a Super User!PBI-Super-User-Rank-30x30-1x

Thank you Kim, I will keep this in mind.

 

Best regards,

Sam Bolsover

KNP
Super User
Super User

Hi Sam,

 

In Power Query, I'd be inclined to select all of the columns that are consistent, right click and choose 'Unpivot other columns' as one of the first steps. This will give you the consistency you need to work with in your measures.

 

Regards,

Kim

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 ;).
chrome-9xf-Zagzel-B

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.
KIfp67uy-Sr
Proud to be a Super User!PBI-Super-User-Rank-30x30-1x
Ashish_Mathur
Super User
Super User

Hi,

If on July 4, 2021, you receive a file which starts with Jul-21, then will this file replace the file which you received in Jun-21?  If yes, then how will you get access to the Jun-21 figures when it is Jul-21?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi Ashish,

 

That is correct. This report is solely for displaying forcast data and so information from prior months is not needed. 

 

Best regards,

Sam Bolsover

Hi,

See if the technique shown here takes into account new columns that you add daily - Power Query #08: Import Multiple Excel Sheets From Multiple Excel Workbooks.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.