If possible I'd change the table structure. Note, it's possible to create an iccube table from an SQL statement.
I'd start by creating a few dimensions :
- Company -> using 'companies' ; Multi-Levels just one level with id &
caption.
- Date -> Use the Time (Wizard); add a start/end matching the data
you've.
- Product -> using 'invoices_data' : Multi-Levels just one level with
id_product for both key & name
If possible I'd add the date to the 'invoice_data', SQL join. If no you can create a Many-2-Many table (advanced) that will do the join for you. More info here, I would not go for m2m unless really needed as it's an advanced features (read the link carefully).
Create a Cube, add 'Facts' with table 'invoice data'. Click on the last button 'Wizard' this will link all dimensions automatically. Eventually add your measures (amount & price).
And that should be it.
hope it helps