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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
DennisSchlein
Helper III
Helper III

Data modelling - how to structure cost/sales with details

Hi 

I'm new to power bi, thus I have completed a few basic courses.

I need advice on how to create my data model - in essence, I have 2 tables, cost and sales.
I work within the transport category, so this is parcel numbers - and surcharges belonging to each parcel number.

These two does not directly have a link, or not everything in my cost table has to be sold.

I want to validate if all parcel numbers we buy, is sold

In my Cost table I can have regular invoices, and credit notes.

And the same goes for Sales.

 

DennisSchlein_2-1693390851863.png

 





Right now I generate a LookupValue on my cost table Which is the parcel number from Sales if its knows. i have tried adding the service code as a string ex.: 00370730257845736894_900 and doing the same on my sales table.

If I do that, then I can generate a new mapping table with all the parcelnumbers and service codes represented in both tables.

But on my cost side, I also want  to see cost component with no sales value:

DennisSchlein_3-1693391419981.png

 

DennisSchlein_4-1693391591062.png

 




I'm sorry fi this makes no sense to you, but I am open to elaborate if needed.

i have created my data model so far like this:

DennisSchlein_5-1693391629162.png

 



And thoughts?

3 REPLIES 3
DennisSchlein
Helper III
Helper III

Hi


Thanks - @amitchandak 

It worked - what I ended doing was creating a table with all non profitable parcels.
Then linking them to a summarized table, with all parcelnumbers and "service codes"

And use that to filter both cost and sales.

And so far, so good:
image.pngimage.png


Using this form of data model:
image.png


But if I add +0 to my measure:

_SumSalesAmountDKK = SUMX(SalesDetail, SalesDetail[SalesAmountDKK])


Then it act like it looses the relation between my calc table:
_SumSalesAmountDKK = SUMX(SalesDetail, SalesDetail[SalesAmountDKK])+0
image.png


Am I drunk?

Thanks in advance, 




DennisSchlein
Helper III
Helper III

I'll have a look, but that looks great 🙂 

amitchandak
Super User
Super User

@DennisSchlein , You need have additional common dimesions

Invoice NO

Parcel

Lookup value

 

etc.

 

Two tables need to be analyzed together with common dimensions and measures

 

Power BI- DAX: When I asked you to create common tables: https://youtu.be/a2CrqCA9geM
https://medium.com/@amitchandak/power-bi-when-i-asked-you-to-create-common-tables-a-quick-dax-soluti...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

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.

Top Solution Authors
Top Kudoed Authors