The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I have a dataset containing columns Jan 2025 - Dec 2025, each column contains the number of consumption of a particular product in that month. Another set of columns same from Jan 2025 - Dec 2025, each column contains the total cost of a particular product in that month. For example, In Jan 2025, Product A consumption is 5 and cost is 2600.
I have unpivoted the columns to get Months in rows, in order to create line chart (to get Months in x-axis, consumption in y-axis. Same for Cost). So now I have two Months column (Jan 2025 - Dec 2025 for consumption), Month column (January 2025 - December 2025 for cost), Consumption and Cost columns. But as i have unpivoted the columns, there are many repeated columns. When I try to build the visuals, I am getting inflated values not the right one. How can i avoid the repeated rows and get distinct ones.
I have tried many methods but eventually did not succeed. I tried to remove duplicates, created DAX measures but when I add slicer, it does not changed every visuals in my dashboard.
PLEASE HELP! IT IS URGENT. I HAVE ONLY 4 DAYS TO SUBMIT THIS.
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.
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.
Thank you for the guidance. I tried DAX measures for cost and consumption and it worked.
Hi @Shana_Nasrin , Thanks for the update. If it solved your issue, kindly consider marking it "Accept as Solution" to help others with similar issues find the solution easily.
Thank you.
Hi @Shana_Nasrin ,
Is this what you are looking for? Let me know if this is what you desired and ping back if you face any difficulties at any step. Thanks
I have attached the file below for your reference.
Please provide a data sample as text which can by copy/pasted, or as a link to a data file you have stored at some publically accessible site (eg onedrive, drive, dropbox, etc) to obtain a more focused response. As presented, it is difficult for me to figure out what your original data sample looks like, and that makes a huge difference in trying to provide a solution.