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
nate17
Regular Visitor

Transforming data in Power Query part of Power BI

Hi I have a csv data source that looks like this:

 

Plant data.PNG

 

I have 6 devices capturing 4 types of data at each hour of the day, then repeats every new day by adding 4 new columns across.

 

What I would like to see is this all unpivoted by Device, Date, Time, L, S, T, E.

 

I can then link to the relevant master tables for analysis.

 

Any unpivoting would need to allow for the fact that each day will add new columns.

 

Any help most appreciated.

 

 
 

 

6 REPLIES 6
Greg_Deckler
Super User
Super User

Please post that as text and then maybe we will have a shot at figuring this out, @ImkeF @edhans 

 

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Does this help? Thanks

nathank* L=Light(mmol) * S=Soil humidity(%) * T=Temperature(?) * E=EC(?s/cm)   
         
FlowerCare(80:EA:CA:88:D5:99)        
Passiflora L13(passiflora caerulea)9/05/2020   10/05/2020   
 LSTELSTE
[01:00]----21314.3171
[02:00]----21313.7171
[03:00]----21313.2171
[04:00]----21413.5168
[05:00]----31413169
[06:00]----21413.9166
[07:00]----21314.3164
[08:00]----21314.3164
[09:00]----461314.6162
[10:00]----15145.453
[11:00]724125.9237481419.8156
[12:00]36081127.612349151426.4141
[13:00]24621225.61359291524.6147
[14:00]54311227.71338291323.9150
[15:00]27911225.8142----
[16:00]66248.148----
[17:00]10281324150----
[18:00]2811320.3163----
[19:00]2811320.3163----
[20:00]81216.9171----
[21:00]7456551734.957----
[22:00]31114.6174----
[23:00]31214.9171----
[24:00]31314.6171----
FlowerCare(80:EA:CA:88:D5:94)        
Passiflora M2(passiflora caerulea)9/05/2020   10/05/2020   
 LSTELSTE
[01:00]----11114.4130
[02:00]----11113.6130
[03:00]----11113.6129
[04:00]----11113.6127
[05:00]----11113.6126
[06:00]----11114.3124
[07:00]----11114.5123
[08:00]----61114.5123
[09:00]----1581115.1126
[10:00]----5161216.9147
[11:00]137024019441221.9134
[12:00]22221126.88848641224.7133
[13:00]8131224.41149101323.1152
[14:00]120312251138121222.9154
[15:00]18531327120----
[16:00]31311327.1120----
[17:00]21371225.7132----
[18:00]4331222.5135----
[19:00]121118.3138----
[20:00]11116.3139----
[21:00]11115.2136----
[22:00]11115134----
[23:00]11115.1131----
[24:00]11114.8130----
FlowerCare(80:EA:CA:88:D5:9F)        
Passiflora D14(passiflora caerulea)9/05/2020   10/05/2020   
 LSTELSTE
[01:00]----41114.1112
[02:00]----51113.4110
[03:00]----51113.4108
[04:00]----41113.4105

If you could link to the CSV file that would be better. Put it in DropBox, Google Drive, or OneDrive and share a link.

And explain the data. You want it to handle Device, Date, Time, L, S, T, E. you said, but I don't see columns for all of those.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Hi refer https://www.dropbox.com/sh/pw08fx5sx77rxos/AAD3wVUSokUMzKJgYR998Kb7a?dl=0

 

I have separated files into 2 tabs - one with original and one with how it should look as a list.

 

Thanks

Wow. This is ugly. Having a hard time of seeing a path forward. I know it can be done, but hitting on the right combo of grouping, transposing, unpivoting.... bleh.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

I've played with this, and I'm not there yet. This is going to require a pretty sophisticated implementation of List.Accumulate to work.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

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.