Hi Matthias,
You can create a rules that has a condition that then does an action.
1. In the canvas select a field or maybe create a button and select it.
2. In the ribbon go to Home tab, look for and click Manage Rules and the Rules task pane will appear.
3. In the Rules task pane, click on New -> Action
4. Still in the Rules task pane look for Condition, underneath Condition run rules when....' Click on that and then you can create your condition to compare two fields.
If you are new to InfoPath there is this channel on YouTube that you may want to check out
https://www.youtube.com/user/qdabra/videos
Jun