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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
koko_pbi
Frequent Visitor

power query unpivot function

hey everyone, 

 

i have a quick question , if you can help me with that,

in my power query i face one issue/or problematic 

my data is in column structured (exemple below) i can unpivot the data for more flexibility and automation ,

but i'm asking myself if the fact that i get a lot of duplicate in some of culumns after unpivoting, will not affect my result when i aggregate through dax measures ????   (average - median - text analysis  - stdev -..... date comparison  )

for exemple i know i can't anymore count the number of rows/of responses, since i dont have ids to count the distinct one (emails are not mondatory, some felt)  (i can try to divide the count of row on the number of cols i unpivot , but perhaps it not so a good idea)

data exemple, let say i have response to a survey 

date            -   question 1       - question 2    -   question 3        -   question 4      -   email    -  company     - comment - language 

 01-01-2022     Res 1                 Res 1                    Res 1                    Res 1             1@gm.com    empty      not so good       en

01-01-2022     Res 2                 Res 2                    Res 2                    Res 2              2@gm.com    google          good       fr

01-02-2022     Res 3                 Res 3                   Res 3                    Res 3              3@gm.com   micros          null       de

 

 

-- afrer unpivot : 

date                                    attribute                      value                  email            company     comment        language               

01-01-2022                         question 1                   Res 1                1@gm.com    empty      not so good       en

01-01-2022                         question 2                   Res 1                  1@gm.com    empty      not so good       en

01-01-2022                         question 3                   Res 1               1@gm.com    empty      not so good       en

01-01-2022                         question 4                   Res 1                1@gm.com    empty      not so good       en

 

01-01-2022                         question1                  Res 2                2@gm.com    google         good       fr

01-01-2022                         question2                   Res 2                  2@gm.com    google         good       fr

01-01-2022                         question 3                  Res 2               2@gm.com    google         good       fr

01-01-2022                         question4                   Res 2                2@gm.com    google         good       fr

.........

 

then my question is, did you already face this situation , what should i take care on ??   will i have false result if i 'm not careful 

 

i will now compare the two situation with some aggregation , but i want you confirmation too, please let me know 

thank you , 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @koko_pbi ,

 

If I understand correctly, you can add an index column as an ID column first and then unpivot.

Add an index column - Power Query | Microsoft Learn

 

                                                                                                                                                         

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

1 REPLY 1
Anonymous
Not applicable

Hi @koko_pbi ,

 

If I understand correctly, you can add an index column as an ID column first and then unpivot.

Add an index column - Power Query | Microsoft Learn

 

                                                                                                                                                         

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.           

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.