Forum Discussion
Comparison between two different fields on a measure
Hello PBI community,
I am new in power BI specialy in DAX language. I try to have my Delivery amount for each Invoice received after the delivery OR for each invoice amount different from the delivery amount.
i try this kind of code :
CALCULATE(
SUM([Delivery_amount]);
YEAR([Invoice_Date]) > YEAR([Delivery_Date]) ;[Invoice_amount]<>[Delivery_amount])
But i have notification that it cannot find name on Delivery_Date and Delivery_amount i don't know why cause the syntax is good for me ...
Sorry for my english hope i am clear and thank you in advance for your help.
4 Replies
- AnonymousNot applicable
One detail all my fields are in the same table.
To give you an example i want to display all the line in green :
Account Delivery_Amount Delivery_Date Invoice_Amount Invoice_Date A 100 2017 A 100 2017 100 2017 A 200 2017 100 2017 A 100 2017 100 2018 A 100 2017 100 2017 A 100 2017 100 2017 A 100 2017 100 2017 A 100 2017 100 2017 - v-chuncz-msftCommunity Support
- AnonymousNot applicable
Thanks for you help v-chuncz-msft
I can add filter but the problem is i don't know why i can't put some condition like
[Invoice_amount]<>[Delivery_amount]. Power Bi tell me that it can't find the name [Delivery_amount].
I can do [Invoice_amount]<> 100
or [Delivery_amount] > 100
That work for test on numeric values but not on :
[Invoice_amount]<>[Delivery_amount]
Why ?
- AnonymousNot applicable
Got it ! i finaly understood my mistake ! Thanks a lot