I am designing a data model for reporting. In the source there are three tables which has to be considered.
Invoice table Test table Services table
Test and services are against an invoice. One invoice can have multiple test as well as multiple services.
eg:
InvoiceId | TestCount | ServicCount |
---|---|---|
123 | 0 | 4 |
435 | 2 | 5 |
435 | 4 | 2 |
To calculate total revenue total amount column in the invoice table can be referred. But for the net revenue. Sum of the Testcost column in Test table and Servicescost column in service cost has to be calculated.
When designing a fact table for Tests and services. I think it's better to go with two fact tables one for test and one for service as they have different granularities and when reporting create a measure to calculate both and get the total net revenue.
Are there any possible other way to keep both test and service detail in same fact? ie. mix of granularities in one single fact?
Any valuable insight please
Thanks in advance
Mixing facts of different grains in the same fact table is about as big a mistake as it is possible to make when designing a fact table.
So, no, it is not possible to keep facts with different grains in the same fact table.