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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.