Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
tvaishnav
Helper IV
Helper IV

How do model data with different granularity?

I have a situation where I want to compare cost and revenue. My revenue number is just an aggregate, however cost has sub categories. How would you model this?

 

I can think of these ways.

 

1) Put revenue in one row and have 0s in all others 

 

ProjectRevenue CostCost Category
Project A1000000500Cat 1
Project A090000Cat 2
Project A08855Cat 3
Project A06000Cat 4

 

2) Make single column for cost and revenue.

 

ProjectTypeValue
Project ARevenue100000
Project ACost Cat 1500
Project ACost Cat 290000
Project ACost Cat 38855
Project ACost Cat 46000

 

3) Create two fact tables one for revenue and another for cost.

 

In general, I have been struggling with this concept of different grains in data for a while. Any pointers on what are the best practices? 

 

 

4 REPLIES 4
PaulDBrown
Community Champion
Community Champion

I would go for option "3) Create two fact tables one for revenue and another for cost" and have a bridge table for Project and any other fileds common to both tables.





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Thank you for your response. Do you think I can create this using matrix visual and two fact tables?

 

ud.PNG

 

Sure, but you will need a table with the row structure for the matrix. SImilar to this, but for rows instead of columns:

Custom Matrix 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






johnt75
Super User
Super User

Have a read of https://www.daxpatterns.com/budget/ by the SQLBI guys, it should give you some ideas about working at different granularities.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.