Forum Discussion
Help comparing two excel worksheets in Power BI
- 9 years ago
Hi enzo2011
Did you find a solution for your issue?
I managed to reproduce your example and came up with this.When importing both of your worksheets, add a custom column to each of them, let's call it "IndexCol" having the values "A" and "B" for each table respectively.
Now that both tables are there with a "flag" for each one, go to edit queries and choose to append queries as new
Choose both tables, one as primary and one as secondary, apply and close.
In your report view, you will now see a new table having all of table A and table B elements.
Create a new calculated column as follows:Q4Files = CALCULATE(SUM(Append1[Files]), Append1[IndexCol]="B") - CALCULATE(SUM(Append1[Files]), Append1[IndexCol]="A")
Choose the table visual and add to it Process and Q4Files, make sure you are making your selection from the newly created table Append1 and that Q4Files is groupes as sum.You should get the following
Tell me how it works!
EDIT: if you have unique process values in both tables, why don't you create a 1:1 relationship between both worksheets on the process. Then create a calculated column on Table2 as follows: Q4Files = Table2[Files]-RELATED(Table1[Files])
Hi enzo2011,
If all this info was in one file, then I would have no problems, so I emphasize the fact that I got two diferent Excel worksheets.
As we can import more than one Excel files as a single dataset in Power BI, you should be able to import both the Excel files into your pbix file with different table names, then do the comparison in this scenario.:smileyhappy:
So just open your existing pbix file with Power BI Desktop, click Get Data to import the new Excel file(B), then all data from both Excel files will be there.
Regards
- enzo20119 years agoFrequent Visitor
Thanks v-ljerr-msft!
That could be an option, but I'm not very keen on adding new fields to my report every quarter from now on... And also I cant compare them row to row beacuse all rows are mixed and also some new ones are added. But still, I'll try to create a personalized column... or a new measure...
- Greg_Deckler9 years agoCommunity Champion
OK, in that circumstance, it sounds like you would need to do a Merge query as a Left or Right Anti join?
- enzo20119 years agoFrequent Visitor
Let me show you a simplified example...
So we have two diferent Excel Files. A and B.
If I wanna know the generated files for each process during the last quarter of 2016 we should subtract one table from the other one. Therefore, as an example, 52 new files have been generated this last quarter for the process RE001, and also the new process (TQ003). As you can see they are not in order. My question is if there's a way to do this operation inside Power BI. Any solution that helps me find the new files and processes generated from a new file that I will get every quarter.
Thank you