Oct 10 2020 06:10 PM - edited Oct 10 2020 06:13 PM
I have this equation:
=if (contains (RELATEDTABLE('ItemMaster 1'),[ItemGroupPrefix],"Equ"), PRODUCTX(RELATEDTABLE('Invoices 1'), 0.4 * 'Invoices 1'[LineTotal]),0)
this looks at a column on a table called ItemMaster 1 and if Equ is in the column it multiplies the data in Invoices 1 {LineTotal] by 0.4. On random cells the data is crazy. See attached.
https://www.dropbox.com/s/p16nk9pdjqrpkjs/Screenshot%202020-10-10%20210858.jpg?dl=0
Any help is appreciated.
Oct 11 2020 02:02 AM
What is contains ? It is not a built-in function as far as I know.
Oct 11 2020 05:42 AM
If in another column to add PRODUCTX() only, without IF(), is it the same result or not?
In general it's better to have more information about the model, in DAX exactly the same formula gives different results depends on context.
Oct 11 2020 08:49 AM
@Sergei Baklan Thanks for the help - I am new at this and trying to learn it on the fly.
I am trying to multiply a column "LineTotal" in the Tab "Invoices 1" by 0.4 if the column in Tab "ItemMaster 1" column "ItemGroupPrefix" equals "Equ".
I am unable to get the productx function to work. I am sure it is me.
Oct 11 2020 09:19 AM
Only formula is not enough. How relationships are built, based on date on something else? If date, is here separate calendar table? Are you on one or many side of relationships?
Just sample model with few records in each table could help better.
Oct 11 2020 09:20 AM
@Sergei Baklan The answer to the question - is the ProductX function working without any other expressions is no. i get crazy numbers.
Oct 11 2020 09:24 AM
@Sergei BaklanYes, i have a calendar table along with item number master, main customer record (business partner) plus invoices and credits. see attached.
Oct 11 2020 09:45 AM
Thank you. But to which table you add calculated column and how this table is related to ItemMaster 1 and Invoices 1 ?
Oct 11 2020 11:06 AM
Thanks for the effort but I am giving up. :(
Oct 13 2020 05:38 AM