Forum Discussion

richardlrz's avatar
richardlrz
New Member
3 years ago
Solved

How to pivot table

Hello I am pretty new for using poweBI desktop, I spent quit bit time try to just pivot a table  from the datasouce, say I have source as : I want to have a visual just make attribute as colum...
  • richardlrz's avatar
    richardlrz
    3 years ago

    amitchandak Thanks for the replay, in deed here is sample what I realy have:

     

    LocationAttributeValueTimeStamp
    LocationShiftDay10/10/2022
    LocationSampleValue1.110/10/2022
    LocationSampleNamePH10/10/2022
    LocationOperationAlex10/10/2022
    LocationShiftNight10/11/2022
    LocationSampleValue2.110/11/2022
    LocationOperationJoe10/11/2022
    LocationNameBF10/11/2022
    LocationShiftDay10/12/2022
    LocationSampleNameNH310/12/2022
    LocationOperationPhil10/12/2022
    LocationNameR/C10/12/2022
    LocationSampleValue5.510/13/2022
    LocationSampleNamePH10/13/2022
    LocationOperationAlex10/13/2022

    Every time I only log the on value changed record, says I have 5 attributes, they are Shift, SampleValue, SampleName, Operation and Name 5 columns, I want pivot the table based on the Attributs on Value, I have successfully done this in the transform and get datasets like below:

    TimeStampeShiftSampleValueSampleNameOperationName
    10/10/2022Day1.1PHAlex 
    10/11/2022Night2.1 JoeBF
    10/12/2022Day NH3PhilR/C
    10/13/2022 5.5PHAlex 

     

    For those  blank cell I would like fill with previous record data and for the first row or couple row which has data can be found m I will use NA to fill those blank cells, so finally I will get :

    The blank cell could happend on any column pivoted (say: Shift, SampleValue, SampleName, Operation and Name each row is based the timeStamp)

     

    TimeStampeShiftSampleValueSampleNameOperationName
    10/10/2022Day1.1PHAlexNA
    10/11/2022Night2.1PHJoeBF
    10/12/2022Day2.1NH3PhilR/C
    10/13/2022Day5.5PHAlexR/C