Forum Discussion
How to avoid repeated rows after unpivoting in power query?
- 1 year ago
Hi Shana_Nasrin , Thank you for reaching out to the Microsoft Community Forum.
Your values were off because consumption and cost were unpivoted separately, which left you with two different Month columns. When those got combined in visuals, Power BI duplicated rows and inflated the sums.
To show you the fix, we built a sample dataset based on our understanding of your scenario. We unpivoted all month columns at once, split the combined header into a single Month column and a Type column, then pivoted Type back into two numeric columns. This creates one clean table (one row per product per month), so totals stay accurate.
We also added a proper date column for sorting, so months now appear in the correct order on your charts. You can see all the steps and working visuals in the attached .pbix built on the sample data.
We attached the .pbix file for your reference and share your thoughts.
Hi Shana_Nasrin , Thanks for the update, please consider marking it Accept as Solution. Doing so can assist other community members in finding answers more quickly.
Thank you.