USERELATIONSHIP - Three tables relations

Anything related to PowerPivot and DAX Formuale
smpascual
Posts: 1
Joined: Tue Jul 28, 2020 5:08 pm

USERELATIONSHIP - Three tables relations

Postby smpascual » Tue Jul 28, 2020 5:18 pm

Dear all,
I'm trying to develop a Measure to obtain Product Cost by Month but I'm getting wrong results.

My datamodel is as following:
Calendar -- Invoice -- InvoiceLines

Which have realtionships below:

1.- Calendar[Date] -- Invoice[Date] --> Active
2.- Calendar[Date] -- Invoice[Cost Date] --> Inactive
3.- Invoice[id] -- InvoiceLines[invoice_id] --> Active

My measure is as following

CALCULATE (
[Euros - Purchase by Product];
USERELATIONSHIP ( Invoice[Cost Date]; 'Calendar'[Date] )
)

[Euros - Purchase by Product] = SUM(InvoiceLines[Amount])

Thanks for your help in advance

masterelaichi
Posts: 43
Joined: Fri Sep 02, 2016 8:36 am

Re: USERELATIONSHIP - Three tables relations

Postby masterelaichi » Tue Jul 28, 2020 8:23 pm

Do you have a sample data? I am not sure what the last line of code, [Euros - Purchase by Product] = SUM(InvoiceLines[Amount]), is being used for

RamanaV
Posts: 65
Joined: Thu Oct 19, 2017 12:57 pm

Re: USERELATIONSHIP - Three tables relations

Postby RamanaV » Tue Jul 28, 2020 11:08 pm

Looks like you 2 transaction(fact/data) tables - Invoice and InvoiceLines
If that's the case you cannot have a relationship between Invoice and InvoiceLines
Ramana Varanasi
Training and Office Manager
Excelerator BI Pty. Ltd.


Return to “PowerPivot/DAX”

Who is online

Users browsing this forum: No registered users and 6 guests